@skypath-io/web-sdk 0.6.0 → 1.0.1
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.
- package/CHANGELOG.md +12 -0
- package/dist/bundle.cjs.js +2 -2
- package/dist/bundle.es.js +2 -2
- package/dist/bundle.iife.js +2 -2
- package/dist/types/src/core/auth/auth.d.ts +1 -0
- package/dist/types/src/core/auth/consts.d.ts +6 -0
- package/dist/types/src/core/monitoring/errors.d.ts +1 -0
- package/dist/types/src/features/oneLayer/flow.d.ts +2 -1
- package/dist/types/src/index.d.ts +20 -0
- package/package.json +1 -1
package/dist/bundle.iife.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @skypath-io/web-sdk
|
|
2
|
+
* @skypath-io/web-sdk v1.0.1
|
|
3
3
|
* SkyPath JavaScript SDK for Web
|
|
4
4
|
* (c) 2026 SkyPath LTD
|
|
5
5
|
*/
|
|
6
|
-
var SkyPathSDK=function(t){"use strict";var e=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,A="";"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),A=0!==A.indexOf("blob:")?A.substr(0,A.lastIndexOf("/")+1):"",i=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=V(t);i?e(i.buffer):n()}},r.onerror=n,r.send(null)};var o=n.print||console.log.bind(console),s=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments;var a=0;var u=!1;function c(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||rt("Assertion failed: "+e),r}function l(t,e,n,r,i){var A={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,A=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=A)break;e[n++]=s}else if(s<=2047){if(n+1>=A)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=A)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=A)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,p,e,n)})(t,e=W(n),n)}return e},array:function(t){var e=W(t.length);return function(t,e){h.set(t,e)}(t,e),e}};var o=c(t),s=[],a=0;if(r)for(var u=0;u<r.length;u++){var l=A[n[u]];l?(0===a&&(a=K()),s[u]=l(r[u])):s[u]=r[u]}var f=o.apply(null,s);return f=function(t){return"string"===e?v(t):"boolean"===e?Boolean(t):t}(f),0!==a&&$(a),f}var f,h,p,d,g,y,_,m="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function v(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&m)return m.decode(t.subarray(e,i));for(var A="";e<i;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var a=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|a:(7&o)<<18|s<<12|a<<6|63&t[e++])<65536)A+=String.fromCharCode(o);else{var u=o-65536;A+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else A+=String.fromCharCode((31&o)<<6|s)}else A+=String.fromCharCode(o)}return A}(p,t,e):""}function b(t,e){return t%e>0&&(t+=e-t%e),t}function w(t){f=t,n.HEAP8=h=new Int8Array(t),n.HEAP16=d=new Int16Array(t),n.HEAP32=g=new Int32Array(t),n.HEAPU8=p=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=y=new Float32Array(t),n.HEAPF64=_=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var E=n.TOTAL_MEMORY||33554432;function C(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}E=(f=n.buffer?n.buffer:new ArrayBuffer(E)).byteLength,w(f),g[7156]=5271536;var I=[],x=[],S=[],N=[];function D(t){I.unshift(t)}function L(t){N.unshift(t)}var T=Math.abs,M=Math.ceil,O=Math.floor,P=Math.min,R=0,k=null;n.preloadedImages={},n.preloadedAudios={};var B,F,G=null,U="data:application/octet-stream;base64,";function Q(t){return String.prototype.startsWith?t.startsWith(U):0===t.indexOf(U)}G="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMAdmVydGV4Um90YXRpb25zAGNlbGxUb1ZlcnRleABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";function z(){return h.length}var q="function"==typeof atob?atob:function(t){var e,n,r,i,A,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(u++))<<2|(i=s.indexOf(t.charAt(u++)))>>4,n=(15&i)<<4|(A=s.indexOf(t.charAt(u++)))>>2,r=(3&A)<<6|(o=s.indexOf(t.charAt(u++))),a+=String.fromCharCode(e),64!==A&&(a+=String.fromCharCode(n)),64!==o&&(a+=String.fromCharCode(r))}while(u<t.length);return a};function V(t){if(Q(t))return function(t){try{for(var e=q(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(U.length))}var Y=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var A=new t.Float64Array(n),o=0|e.o,s=0|e.p,a=t.Math.floor,u=t.Math.abs,c=t.Math.sqrt,l=t.Math.pow,f=t.Math.cos,h=t.Math.sin,p=t.Math.tan,d=t.Math.acos,g=t.Math.asin,y=t.Math.atan,_=t.Math.atan2,m=t.Math.ceil,v=t.Math.imul,b=t.Math.min,w=t.Math.max,E=t.Math.clz32,C=e.b,I=e.c,x=e.d,S=e.e,N=e.f,D=e.g,L=e.h,T=e.i,M=28656;function O(t,e,n,r){return 0|P(t|=0,e|=0,n|=0,r|=0,0)}function P(t,e,n,r,A){var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,a=o,!(0|R(t|=0,e|=0,n|=0,r|=0,A|=0)))return M=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|de(15,a)))break;a=0|i[(u=a)>>2],u=0|i[u+4>>2]}else c=0|sn(0|n,0|(s=((0|n)<0)<<31>>31),3,0),u=0|I(),s=0|en(0|n,0|s,1,0),s=0|en(0|(s=0|sn(0|c,0|u,0|s,0|I())),0|I(),1,0),u=0|I(),i[a>>2]=s,i[a+4>>2]=u,a=s;if(_n(0|r,0,a<<3),0|A){_n(0|A,0,a<<2),s=0|k(t,e,n,r,A,a,u,0);break}(s=0|tn(a,4))?(c=0|k(t,e,n,r,s,a,u,0),Ze(s),s=c):s=13}else s=2}while(0);return M=o,0|(c=s)}function R(t,e,n,r,A){t|=0,e|=0,n|=0,r|=0,A|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,g=s+8|0,i[(d=o=s)>>2]=t,i[d+4>>2]=e,(0|n)<0)return M=s,0|(g=2);if(i[(a=r)>>2]=t,i[a+4>>2]=e,(a=!!(0|A))&&(i[A>>2]=0),0|jt(t,e))return M=s,0|(g=9);i[g>>2]=0;t:do{if((0|n)>=1)if(a)for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|jt(a=0|i[(e=o)>>2],e=0|i[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|i[26800+(p<<2)>>2],g,o)))break t;if(a=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(h<<3)|0)>>2]=a,i[t+4>>2]=e,i[A+(h<<2)>>2]=d,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|jt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|jt(a=0|i[(e=o)>>2],e=0|i[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|i[26800+(p<<2)>>2],g,o)))break t;if(a=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(h<<3)|0)>>2]=a,i[t+4>>2]=e,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|jt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else a=0}while(0);return M=s,0|(g=a)}function k(t,e,n,r,A,o,s,a){n|=0,r|=0,A|=0,a|=0;var u,c,l,f=0,h=0,p=0,d=0,g=0,y=0,_=0;if(l=M,M=M+16|0,u=l+8|0,c=l,f=0|un(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),p=0|I(),!(!(0|(_=0|i[(y=d=r+(f<<3)|0)>>2]))&!(0|(y=0|i[y+4>>2]))|(h=(0|_)==(0|t)&(0|y)==(0|e))))do{f=0|an(0|(f=0|en(0|f,0|p,1,0)),0|I(),0|o,0|s),p=0|I(),h=(0|(y=0|i[(_=d=r+(f<<3)|0)>>2]))==(0|t)&(0|(_=0|i[_+4>>2]))==(0|e)}while(!(!(0|y)&!(0|_)|h));if(f=A+(f<<2)|0,h&&(0|i[f>>2])<=(0|a))return M=l,0|(_=0);if(i[(_=d)>>2]=t,i[_+4>>2]=e,i[f>>2]=a,(0|a)>=(0|n))return M=l,0|(_=0);switch(h=a+1|0,i[u>>2]=0,0|(f=0|B(t,e,2,u,c))){case 9:g=9;break;case 0:(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h))||(g=9)}t:do{if(9==(0|g)){switch(i[u>>2]=0,0|(f=0|B(t,e,3,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,1,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,5,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,4,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,6,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}return M=l,0|(_=0)}}while(0);return M=l,0|(_=f)}function B(t,e,n,r,A){t|=0,e|=0,A|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if((n|=0)>>>0>6)return 0|(A=1);if(f=(0|i[(r|=0)>>2])%6|0,i[r>>2]=f,(0|f)>0){a=0;do{n=0|bt(n),a=a+1|0}while((0|a)<(0|i[r>>2]))}if(f=0|ln(0|t,0|e,45),I(),(s=127&f)>>>0>121)return 0|(A=5);o=0|Wt(t,e),a=0|ln(0|t,0|e,52),I(),a&=15;t:do{if(a){for(;;){if(c=0|ln(0|t,0|e,0|(u=3*(15-a|0)|0)),I(),7==(0|(c&=7))){e=5;break}if(p=!(0|te(a)),a=a+-1|0,h=0|fn(7,0,0|u),e&=~I(),t=0|fn(0|i[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|t&~h,e|=u=0|I(),!(n=0|i[(p?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!a){l=8;break t}}return 0|e}l=8}while(0);8==(0|l)&&(t|=0|fn(0|(p=0|i[848+(28*s|0)+(n<<2)>>2]),0,45),e=I()|-1040385&e,n=0|i[4272+(28*s|0)+(n<<2)>>2],127&~p||(p=0|fn(0|i[848+(28*s|0)+20>>2],0,45),e=I()|-1040385&e,n=0|i[4272+(28*s|0)+20>>2],t=0|Kt(p|t,e),e=0|I(),i[r>>2]=1+(0|i[r>>2]))),c=0|ln(0|t,0|e,45),I(),c&=127;t:do{if(0|z(c)){e:do{if(1==(0|Wt(t,e))){if((0|s)!=(0|c)){if(0|j(c,0|i[7696+(28*s|0)>>2])){t=0|Zt(t,e),u=1,e=0|I();break}x(27795,26864,533,26872)}switch(0|o){case 3:t=0|Kt(t,e),e=0|I(),i[r>>2]=1+(0|i[r>>2]),u=0;break e;case 5:t=0|Zt(t,e),e=0|I(),i[r>>2]=5+(0|i[r>>2]),u=0;break e;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){a=0;do{t=0|$t(t,e),e=0|I(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|q(c))){if(!!(0|u)|5!=(0|Wt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&f){case 8:case 118:break t}3!=(0|Wt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){a=0;do{t=0|Kt(t,e),e=0|I(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(p=A)>>2]=t,i[p+4>>2]=e,0|(p=0)}function F(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var A,o,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(o=M,M=M+16|0,d=o+8|0,i[(p=A=o)>>2]=t,i[p+4>>2]=e,(0|n)<0)return M=o,0|(d=2);if(!n)return i[(d=r)>>2]=t,i[d+4>>2]=e,M=o,0|(d=0);i[d>>2]=0;t:do{if(0|jt(t,e))t=9;else{s=0,p=t;do{if(0|(t=0|B(p,e,4,d,A)))break t;if(s=s+1|0,0|jt(p=0|i[(e=A)>>2],e=0|i[e+4>>2])){t=9;break t}}while((0|s)<(0|n));i[(h=r)>>2]=p,i[h+4>>2]=e,h=n+-1|0,f=0,t=1;do{if(s=26800+(f<<2)|0,5==(0|f))for(u=0|i[s>>2],a=0,s=t;;){if(0|(t=0|B(0|i[(t=A)>>2],0|i[t+4>>2],u,d,A)))break t;if((0|a)!=(0|h)){if(c=0|i[(l=A)>>2],l=0|i[l+4>>2],i[(t=r+(s<<3)|0)>>2]=c,i[t+4>>2]=l,0|jt(c,l)){t=9;break t}t=s+1|0}else t=s;if((0|(a=a+1|0))>=(0|n))break;s=t}else for(u=A,l=0|i[s>>2],c=0,s=t,a=0|i[u>>2],u=0|i[u+4>>2];;){if(0|(t=0|B(a,u,l,d,A)))break t;if(a=0|i[(u=A)>>2],u=0|i[u+4>>2],i[(t=r+(s<<3)|0)>>2]=a,i[t+4>>2]=u,t=s+1|0,0|jt(a,u)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}f=f+1|0}while(f>>>0<6);t=(0|p)==(0|i[(t=A)>>2])&&(0|e)==(0|i[t+4>>2])?0:9}}while(0);return M=o,0|(d=t)}function G(t,e,n,r){t|=0,e|=0,r|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;if(A=M,M=M+16|0,a=A,!(n|=0))return i[r>>2]=t,i[r+4>>2]=e,M=A,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(o=0|de(15,a)))break;o=0|i[(s=a)>>2],s=0|i[s+4>>2]}else f=0|sn(0|n,0|(o=((0|n)<0)<<31>>31),3,0),s=0|I(),o=0|en(0|n,0|o,1,0),o=0|en(0|(o=0|sn(0|f,0|s,0|o,0|I())),0|I(),1,0),s=0|I(),i[(f=a)>>2]=o,i[f+4>>2]=s;if(l=0|tn(o,8)){if(!(f=0|tn(o,4))){Ze(l),o=13;break}if(0|(o=0|k(t,e,n,l,f,o,s,0))){Ze(l),Ze(f);break}if(e=0|i[a>>2],(0|(a=0|i[a+4>>2]))>0|!(0|a)&e>>>0>0){o=0,u=0,c=0;do{!(0|(s=0|i[(t=l+(u<<3)|0)>>2]))&!(0|(t=0|i[t+4>>2]))||(0|i[f+(u<<2)>>2])!=(0|n)||(i[(h=r+(o<<3)|0)>>2]=s,i[h+4>>2]=t,o=o+1|0),u=0|en(0|u,0|c,1,0),c=0|I()}while((0|c)<(0|a)|(0|c)==(0|a)&u>>>0<e>>>0)}Ze(l),Ze(f),o=0}else o=13}else o=2}while(0);return M=A,0|(h=o)}function U(t,e,n,r){n|=0,r|=0;var A,o,s,a=0,u=0;for(s=M,M=M+16|0,A=s,o=s+8|0,a=(a=!(0|jt(t|=0,e|=0)))?1:2;;){if(i[o>>2]=0,!(0|B(t,e,a,o,A))&((0|i[(u=A)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0)){t=4;break}if((a=a+1|0)>>>0>=7){a=7,t=4;break}}return 4==(0|t)?(M=s,0|a):0}function Q(t,e,n,r,o,s,a){e|=0,n|=0,r|=0,o|=0,s|=0,a|=0;var u,c,l,f,h,p,d,g,y,_,m=0,v=0,b=0,w=0,E=0,C=0,x=0,S=0,N=0,D=0,L=0,T=0,O=0,P=0,R=0,k=0,B=0,F=0,G=0;if(_=M,M=M+64|0,d=_+48|0,g=_+32|0,y=_+24|0,u=_+8|0,c=_,(0|(v=0|i[(t|=0)>>2]))<=0)return M=_,0|(R=0);for(l=t+4|0,f=d+8|0,h=g+8|0,p=u+8|0,m=0,O=0;;){T=(b=0|i[l>>2])+(O<<4)|0,i[d>>2]=i[T>>2],i[d+4>>2]=i[T+4>>2],i[d+8>>2]=i[T+8>>2],i[d+12>>2]=i[T+12>>2],(0|O)==(v+-1|0)?(i[g>>2]=i[b>>2],i[g+4>>2]=i[b+4>>2],i[g+8>>2]=i[b+8>>2],i[g+12>>2]=i[b+12>>2]):(T=b+(O+1<<4)|0,i[g>>2]=i[T>>2],i[g+4>>2]=i[T+4>>2],i[g+8>>2]=i[T+8>>2],i[g+12>>2]=i[T+12>>2]),v=0|rt(d,g,r,y);t:do{if(v)b=0,m=v;else if(b=0|i[(v=y)>>2],(0|(v=0|i[v+4>>2]))>0|!(0|v)&b>>>0>0){L=0,T=0;e:for(;;){if(B=1/(+(b>>>0)+4294967296*+(0|v)),G=+A[d>>3],F=+((v=0|nn(0|b,0|v,0|L,0|T))>>>0)+4294967296*+(0|I()),k=+(L>>>0)+4294967296*+(0|T),A[u>>3]=B*(G*F)+B*(+A[g>>3]*k),A[p>>3]=B*(+A[f>>3]*F)+B*(+A[h>>3]*k),0|(v=0|ee(u,r,c))){m=v;break}C=0|un(0|(N=0|i[(D=c)>>2]),0|(D=0|i[D+4>>2]),0|e,0|n),w=0|I(),b=0|i[(E=v=a+(C<<3)|0)>>2],E=0|i[E+4>>2];n:do{if(!(0|b)&!(0|E))P=v,R=16;else for(x=0,S=0;;){if((0|x)>(0|n)|(0|x)==(0|n)&S>>>0>e>>>0){m=1;break e}if((0|b)==(0|N)&(0|E)==(0|D))break n;if(C=0|an(0|(v=0|en(0|C,0|w,1,0)),0|I(),0|e,0|n),w=0|I(),S=0|en(0|S,0|x,1,0),x=0|I(),!(0|(b=0|i[(E=v=a+(C<<3)|0)>>2]))&!(0|(E=0|i[E+4>>2]))){P=v,R=16;break}}}while(0);if(16!=(0|R)||(R=0,!(0|N)&!(0|D))||(i[(S=P)>>2]=N,i[S+4>>2]=D,S=s+(i[o>>2]<<3)|0,i[S>>2]=N,i[S+4>>2]=D,S=0|en(0|i[(S=o)>>2],0|i[S+4>>2],1,0),N=0|I(),i[(D=o)>>2]=S,i[D+4>>2]=N),L=0|en(0|L,0|T,1,0),T=0|I(),b=0|i[(v=y)>>2],!((0|(v=0|i[v+4>>2]))>(0|T)|(0|v)==(0|T)&b>>>0>L>>>0)){b=1;break t}}b=0}else b=1}while(0);if(O=O+1|0,!b){R=21;break}if((0|O)>=(0|(v=0|i[t>>2]))){m=0,R=21;break}}return 21==(0|R)?(M=_,0|m):0}function z(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|i[7696+(28*t|0)+16>>2])}function q(t){return 4==(0|(t|=0))|117==(0|t)|0}function V(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function Y(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7696+(28*t|0)+24>>2])==(0|e))}function H(t,e){return 0|i[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function X(t,e){return e|=0,(0|i[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[848+(28*t|0)+24>>2])==(0|e)?6:7)}function W(t){var e,n,r;return e=(r=+A[(t|=0)+16>>3])-(n=+A[t+24>>3]),+(r<n?e+6.283185307179586:e)}function $(t){return+A[(t|=0)+16>>3]<+A[t+24>>3]|0}function K(t){return+(+A[(t|=0)>>3]-+A[t+8>>3])}function J(t,e){t|=0;var n,r,i=0;return(i=+A[(e|=0)>>3])>=+A[t+8>>3]&&i<=+A[t>>3]?(n=+A[t+16>>3],i=+A[t+24>>3],e=(r=+A[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Z(t,e){e|=0;var n,r,i,o,s,a=0,u=0,c=0,l=0;return+A[(t|=0)>>3]<+A[e+8>>3]||+A[t+8>>3]>+A[e>>3]?0|(a=0):(i=(u=+A[t+16>>3])<(l=+A[(n=t+24|0)>>3]),c=(s=+A[(a=e+16|0)>>3])<(o=+A[(r=e+24|0)>>3]),e=l-s<o-u,t=i?c|e?1:2:0,e=c?i?1:e?2:1:0,(u=+fe(u,t))<+fe(+A[r>>3],e)||(l=+fe(+A[n>>3],t))>+fe(+A[a>>3],e)?0|(c=0):0|(c=1))}function tt(t,e){e|=0;var n,r,i,o,s,a=0,u=0,c=0,l=0;return+A[(t|=0)>>3]<+A[e>>3]||+A[t+8>>3]>+A[e+8>>3]?0|(a=0):(i=(o=+A[(a=t+16|0)>>3])<(u=+A[t+24>>3]),c=(l=+A[(n=e+16|0)>>3])<(s=+A[(r=e+24|0)>>3]),e=u-l<s-o,t=i?c|e?1:2:0,e=c?i?1:e?2:1:0,(u=+fe(u,t))<=+fe(+A[r>>3],e)?0|(c=(l=+fe(+A[a>>3],t))>=+fe(+A[n>>3],e)):0|(c=0))}function et(t,e){t|=0,e|=0;var n,r,o,s,a,u=0;o=M,M=M+176|0,i[(r=o)>>2]=4,u=+A[e>>3],A[r+8>>3]=u,s=+A[e+16>>3],A[r+16>>3]=s,A[r+24>>3]=u,u=+A[e+24>>3],A[r+32>>3]=u,a=+A[e+8>>3],A[r+40>>3]=a,A[r+48>>3]=u,A[r+56>>3]=a,A[r+64>>3]=s,n=(e=r+72|0)+96|0;do{i[e>>2]=0,e=e+4|0}while((0|e)<(0|n));yn(0|t,0|r,168),M=o}function nt(t,e,n){t|=0,e|=0,n|=0;var r,s,c,l,f,h,p,d=0,g=0,y=0,_=0,v=0,w=0,E=0;h=M,M=M+288|0,f=h+264|0,_=h+96|0,g=(d=y=h)+96|0;do{i[d>>2]=0,d=d+4|0}while((0|d)<(0|g));return 0|(e=0|oe(e,y))?(M=h,0|(w=e)):(ie(y=0|i[(g=y)>>2],g=0|i[g+4>>2],f),Ae(y,g,_),l=+he(f,_+8|0),A[f>>3]=+A[t>>3],A[(g=f+8|0)>>3]=+A[t+16>>3],A[_>>3]=+A[t+8>>3],A[(y=_+8|0)>>3]=+A[t+24>>3],s=+he(f,_),E=+A[g>>3]-+A[y>>3],c=+u(+E),p=+A[f>>3]-+A[_>>3],r=+u(+p),!(0==E|0==p)&&(E=+pn(+c,+r),E=+m(+s*s/+dn(+E/+dn(+c,+r),3)/(l*(2.59807621135*l)*.8)),A[o>>3]=E,v=~~E>>>0,w=+u(E)>=1?E>0?~~+b(+a(E/4294967296),4294967295)>>>0:~~+m((E-+(~~E>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2])?(_=!(0|v)&!(0|w),i[(e=n)>>2]=_?1:v,i[e+4>>2]=_?0:w,e=0):e=1,M=h,0|(w=e))}function rt(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,l,f,h=0,p=0,d=0;f=M,M=M+288|0,c=f+264|0,l=f+96|0,s=(h=p=f)+96|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|s));return 0|(n=0|oe(n,p))?(M=f,0|(r=n)):(ie(h=0|i[(n=p)>>2],n=0|i[n+4>>2],c),Ae(h,n,l),d=+he(c,l+8|0),d=+m(+ +he(t,e)/(2*d)),A[o>>3]=d,n=~~d>>>0,h=+u(d)>=1?d>0?~~+b(+a(d/4294967296),4294967295)>>>0:~~+m((d-+(~~d>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2]?(p=!(0|n)&!(0|h),i[r>>2]=p?1:n,i[r+4>>2]=p?0:h,M=f,0|(r=0)):(M=f,0|(r=1)))}function it(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function At(t,e){t|=0;var n,r,o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0;i[(s=(e|=0)+8|0)>>2]=0,r=+A[t>>3],f=+u(+r),o=+A[t+8>>3],f+=.5*(h=1.1547005383792515*+u(+o)),f-=+(0|(a=~~f)),h-=+(0|(t=~~h));do{if(f<.5){if(f<.3333333333333333){if(i[e>>2]=a,h<.5*(f+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(h<(d=1-f)))+t|0,i[e+4>>2]=t,d<=h&h<2*f){a=a+1|0,i[e>>2]=a;break}i[e>>2]=a;break}if(!(f<.6666666666666666)){if(a=a+1|0,i[e>>2]=a,h<.5*f){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(h<1-f){if(i[e+4>>2]=t,2*f-1<h){i[e>>2]=a;break}}else t=t+1|0,i[e+4>>2]=t;a=a+1|0,i[e>>2]=a}while(0);do{if(r<0){if(1&t){a=~~(+(0|a)-(2*(+((p=0|nn(0|a,((0|a)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|I()))+1)),i[e>>2]=a;break}a=~~(+(0|a)-2*(+((p=0|nn(0|a,((0|a)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|I()))),i[e>>2]=a;break}}while(0);p=e+4|0,o<0&&(a=a-((1|t<<1)/2|0)|0,i[e>>2]=a,t=0-t|0,i[p>>2]=t),c=t-a|0,(0|a)<0?(l=0-a|0,i[p>>2]=c,i[s>>2]=l,i[e>>2]=0,t=c,a=0):l=0,(0|t)<0&&(a=a-t|0,i[e>>2]=a,l=l-t|0,i[s>>2]=l,i[p>>2]=0,t=0),n=a-l|0,c=t-l|0,(0|l)<0&&(i[e>>2]=n,i[p>>2]=c,i[s>>2]=0,t=c,a=n,l=0),(0|(c=(0|l)<(0|(c=(0|t)<(0|a)?t:a))?l:c))<=0||(i[e>>2]=a-c,i[p>>2]=t-c,i[s>>2]=l-c)}function ot(t){var e,n=0,r=0,A=0,o=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,o=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=o,i[e>>2]=0,r=0):(s=o=t+8|0,o=0|i[o>>2]),(0|o)<0&&(n=n-o|0,i[t>>2]=n,r=r-o|0,i[e>>2]=r,i[s>>2]=0,o=0),(0|(A=(0|o)<(0|(A=(0|r)<(0|n)?r:n))?o:A))<=0||(i[t>>2]=n-A,i[e>>2]=r-A,i[s>>2]=o-A)}function st(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),A[e>>3]=+((0|i[t>>2])-r|0)-.5*n,A[e+8>>3]=.8660254037844386*n}function at(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function ut(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function ct(t,e){e|=0;var n,r=0;r=0|v(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|v(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|v(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function lt(t){var e,n,r=0,A=0,o=0,s=0,a=0;a=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(A=(0|(s=((e=(0|(o=(0|i[t+4>>2])-(a?n:0)|0))<0)?0-o|0:0)+((0|i[t+8>>2])-(a?n:0))|0))<0)?0:s)-((o=(0|(A=(0|t)<(0|(A=(0|(r=(e?0:o)-(A?s:0)|0))<(0|(s=(a?0:n)-(e?o:0)-(A?s:0)|0))?r:s))?t:A))>0)?A:0)|0,r=r-(o?A:0)|0;t:do{switch(s-(o?A:0)|0){case 0:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?1:7:0);case 1:return 0|(a=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(a=7)}function ft(t){var e,n,r=0,A=0,o=0,s=0,a=0,u=0,c=0;if(u=0|i[(n=(t|=0)+8|0)>>2],(e=(0|i[t>>2])-u|0)>>>0>715827881|(u=(0|i[(c=t+4|0)>>2])-u|0)>>>0>715827881){if(s=2147483647-e|0,a=-2147483648-e|0,(o=(0|e)>0)?(0|s)<(0|e):(0|a)>(0|e))return 0|(c=1);if(A=e<<1,o?(2147483647-A|0)<(0|e):(-2147483648-A|0)>(0|e))return 0|(c=1);if((0|u)>0?(2147483647-u|0)<(0|u):(-2147483648-u|0)>(0|u))return 0|(c=1);if(r=3*e|0,A=u<<1,(o?(0|s)<(0|A):(0|a)>(0|A))||((0|e)>-1?(-2147483648|r)>=(0|u):(-2147483648^r)<(0|u)))return 0|(c=1)}else A=u<<1,r=3*e|0;return o=0|Ke(.14285714285714285*+(r-u|0)),i[t>>2]=o,s=0|Ke(.14285714285714285*+(A+e|0)),i[c>>2]=s,i[n>>2]=0,r=(A=(0|s)<(0|o))?o:s,(0|(A=A?s:o))<0&&((-2147483648==(0|A)||((0|r)>0?(2147483647-r|0)<(0|A):(-2147483648-r|0)>(0|A)))&&x(27795,26892,354,26903),((0|r)>-1?(-2147483648|r)>=(0|A):(-2147483648^r)<(0|A))&&x(27795,26892,354,26903)),r=s-o|0,(0|o)<0?(A=0-o|0,i[c>>2]=r,i[n>>2]=A,i[t>>2]=0,o=0):(r=s,A=0),(0|r)<0&&(o=o-r|0,i[t>>2]=o,A=A-r|0,i[n>>2]=A,i[c>>2]=0,r=0),a=o-A|0,s=r-A|0,(0|A)<0?(i[t>>2]=a,i[c>>2]=s,i[n>>2]=0,r=s,s=a,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|r)<(0|s)?r:s))?A:o))<=0||(i[t>>2]=s-o,i[c>>2]=r-o,i[n>>2]=A-o),0|(c=0)}function ht(t){var e,n=0,r=0,A=0,o=0,s=0,a=0,u=0;if(o=0|i[(e=(t|=0)+8|0)>>2],(s=(0|i[t>>2])-o|0)>>>0>715827881|(o=(0|i[(a=t+4|0)>>2])-o|0)>>>0>715827881){if((r=(0|s)>0)?(2147483647-s|0)<(0|s):(-2147483648-s|0)>(0|s))return 0|(a=1);if(n=s<<1,(A=(0|o)>0)?(2147483647-o|0)<(0|o):(-2147483648-o|0)>(0|o))return 0|(a=1);if(u=o<<1,A?(2147483647-u|0)<(0|o):(-2147483648-u|0)>(0|o))return 0|(u=1);if(r?(2147483647-n|0)<(0|o):(-2147483648-n|0)>(0|o))return 0|(u=1);if(r=3*o|0,(0|o)>-1?(-2147483648|r)>=(0|s):(-2147483648^r)<(0|s))return 0|(u=1)}else r=3*o|0,n=s<<1;return A=0|Ke(.14285714285714285*+(n+o|0)),i[t>>2]=A,o=0|Ke(.14285714285714285*+(r-s|0)),i[a>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|A))?A:o,(0|(r=r?o:A))<0&&((-2147483648==(0|r)||((0|n)>0?(2147483647-n|0)<(0|r):(-2147483648-n|0)>(0|r)))&&x(27795,26892,402,26917),((0|n)>-1?(-2147483648|n)>=(0|r):(-2147483648^n)<(0|r))&&x(27795,26892,402,26917)),n=o-A|0,(0|A)<0?(r=0-A|0,i[a>>2]=n,i[e>>2]=r,i[t>>2]=0,A=0):(n=o,r=0),(0|n)<0&&(A=A-n|0,i[t>>2]=A,r=r-n|0,i[e>>2]=r,i[a>>2]=0,n=0),s=A-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[a>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=A,(0|(A=(0|r)<(0|(A=(0|n)<(0|o)?n:o))?r:A))<=0||(i[t>>2]=o-A,i[a>>2]=n-A,i[e>>2]=r-A),0|(u=0)}function pt(t){var e,n,r=0,A=0,o=0,s=0,a=0;A=0|i[(e=(t|=0)+8|0)>>2],o=0|Ke(.14285714285714285*+((3*(r=(0|i[t>>2])-A|0)|0)-(A=(0|i[(n=t+4|0)>>2])-A|0)|0)),i[t>>2]=o,r=0|Ke(.14285714285714285*+((A<<1)+r|0)),i[n>>2]=r,i[e>>2]=0,A=r-o|0,(0|o)<0?(a=0-o|0,i[n>>2]=A,i[e>>2]=a,i[t>>2]=0,r=A,o=0,A=a):A=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,A=A-r|0,i[e>>2]=A,i[n>>2]=0,r=0),a=o-A|0,s=r-A|0,(0|A)<0?(i[t>>2]=a,i[n>>2]=s,i[e>>2]=0,r=s,s=a,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|r)<(0|s)?r:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=A-o)}function dt(t){var e,n,r=0,A=0,o=0,s=0,a=0;A=0|i[(e=(t|=0)+8|0)>>2],o=0|Ke(.14285714285714285*+(((r=(0|i[t>>2])-A|0)<<1)+(A=(0|i[(n=t+4|0)>>2])-A|0)|0)),i[t>>2]=o,r=0|Ke(.14285714285714285*+((3*A|0)-r|0)),i[n>>2]=r,i[e>>2]=0,A=r-o|0,(0|o)<0?(a=0-o|0,i[n>>2]=A,i[e>>2]=a,i[t>>2]=0,r=A,o=0,A=a):A=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,A=A-r|0,i[e>>2]=A,i[n>>2]=0,r=0),a=o-A|0,s=r-A|0,(0|A)<0?(i[t>>2]=a,i[n>>2]=s,i[e>>2]=0,r=s,s=a,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|r)<(0|s)?r:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=A-o)}function gt(t){var e,n,r,A=0,o=0,s=0,a=0;A=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],a=o+(3*A|0)|0,i[t>>2]=a,o=s+(3*o|0)|0,i[n>>2]=o,A=(3*s|0)+A|0,i[r>>2]=A,s=o-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=s,i[r>>2]=A,i[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function yt(t){var e,n,r,A=0,o=0,s=0,a=0;a=0|i[(t|=0)>>2],s=(3*(A=0|i[(n=t+4|0)>>2])|0)+a|0,a=(o=0|i[(r=t+8|0)>>2])+(3*a|0)|0,i[t>>2]=a,i[n>>2]=s,A=(3*o|0)+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,i[t>>2]=a,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=a-A|0,s=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,a=e,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|s)<(0|a)?s:a))?A:o))<=0||(i[t>>2]=a-o,i[n>>2]=s-o,i[r>>2]=A-o)}function _t(t,e){t|=0;var n,r,A,o=0,s=0,a=0;((e|=0)+-1|0)>>>0>=6||(a=(0|i[15440+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=a,A=t+4|0,s=(0|i[15440+(12*e|0)+4>>2])+(0|i[A>>2])|0,i[A>>2]=s,r=t+8|0,e=(0|i[15440+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,o=s-a|0,(0|a)<0?(e=e-a|0,i[A>>2]=o,i[r>>2]=e,i[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,i[t>>2]=s,e=e-o|0,i[r>>2]=e,i[A>>2]=0,o=0),n=s-e|0,a=o-e|0,(0|e)<0?(i[t>>2]=n,i[A>>2]=a,i[r>>2]=0,s=n,e=0):a=o,(0|(o=(0|e)<(0|(o=(0|a)<(0|s)?a:s))?e:o))<=0||(i[t>>2]=s-o,i[A>>2]=a-o,i[r>>2]=e-o))}function mt(t){var e,n,r,A=0,o=0,s=0,a=0;a=0|i[(t|=0)>>2],s=(A=0|i[(n=t+4|0)>>2])+a|0,a=(o=0|i[(r=t+8|0)>>2])+a|0,i[t>>2]=a,i[n>>2]=s,A=o+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function vt(t){var e,n,r,A=0,o=0,s=0,a=0;A=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],o=0|i[(r=t+8|0)>>2],a=s+A|0,i[t>>2]=a,s=o+s|0,i[n>>2]=s,A=o+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function bt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function wt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function Et(t){var e,n,r,A=0,o=0,s=0,a=0;A=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],a=o+(A<<1)|0,i[t>>2]=a,o=s+(o<<1)|0,i[n>>2]=o,A=(s<<1)+A|0,i[r>>2]=A,s=o-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=s,i[r>>2]=A,i[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function Ct(t){var e,n,r,A=0,o=0,s=0,a=0;a=0|i[(t|=0)>>2],s=((A=0|i[(n=t+4|0)>>2])<<1)+a|0,a=(o=0|i[(r=t+8|0)>>2])+(a<<1)|0,i[t>>2]=a,i[n>>2]=s,A=(o<<1)+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,i[t>>2]=a,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=a-A|0,s=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,a=e,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|s)<(0|a)?s:a))?A:o))<=0||(i[t>>2]=a-o,i[n>>2]=s-o,i[r>>2]=A-o)}function It(t,e){e|=0;var n,r,A,o=0,s=0,a=0;return A=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(A?r:0)|0))<0,e=(e=(t=(0|(a=(A?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:a)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?a:0)|0))<(0|(a=(A?0:r)-(n?s:0)-(t?a:0)|0))?o:a))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=a-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function xt(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function St(t,e){e|=0;var n,r,A,o=0,s=0,a=0;if(s=0|i[(t|=0)>>2],i[e>>2]=s,a=0|i[t+4>>2],i[(r=e+4|0)>>2]=a,i[(A=e+8|0)>>2]=0,t=(o=(0|a)<(0|s))?s:a,(0|(o=o?a:s))<0){if(-2147483648==(0|o)||((0|t)>0?(2147483647-t|0)<(0|o):(-2147483648-t|0)>(0|o)))return 0|(e=1);if((0|t)>-1?(-2147483648|t)>=(0|o):(-2147483648^t)<(0|o))return 0|(e=1)}return t=a-s|0,(0|s)<0?(o=0-s|0,i[r>>2]=t,i[A>>2]=o,i[e>>2]=0,s=0):(t=a,o=0),(0|t)<0&&(s=s-t|0,i[e>>2]=s,o=o-t|0,i[A>>2]=o,i[r>>2]=0,t=0),n=s-o|0,a=t-o|0,(0|o)<0?(i[e>>2]=n,i[r>>2]=a,i[A>>2]=0,t=a,a=n,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|a)?t:a))?o:s))<=0||(i[e>>2]=a-s,i[r>>2]=t-s,i[A>>2]=o-s),0|(e=0)}function Nt(t){var e,n,r,A;n=(A=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-A|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function Dt(t){var e,n,r=0,A=0,o=0,s=0,a=0;r=0-(A=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(o=0|i[(n=t+4|0)>>2])+A|0,(0|A)>0?(i[n>>2]=s,i[e>>2]=A,i[t>>2]=0,r=0,o=s):A=0,(0|o)<0?(a=r-o|0,i[t>>2]=a,A=A-o|0,i[e>>2]=A,i[n>>2]=0,s=a-A|0,r=0-A|0,(0|A)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,o=r,A=0):(o=0,s=a)):s=r,(0|(r=(0|A)<(0|(r=(0|o)<(0|s)?o:s))?A:r))<=0||(i[t>>2]=s-r,i[n>>2]=o-r,i[e>>2]=A-r)}function Lt(t,e){var n=0;switch(n=0|ln(0|(t|=0),0|(e|=0),56),I(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|jt(t,n))?0|(n=0):0|(n=0|zt(t,n)):0|(n=0)}function Tt(t,e,n){n|=0;var r,A,o=0,s=0;return A=M,M=M+16|0,r=A,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|ln(0|(t|=0),0|e,56),I(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,A=0,o=0;if(o=M,M=M+16|0,A=o,r=0|jt(t,e),(n+-1|0)>>>0>5)return M=o,0|(A=-1);if(r=!!(0|r),1==(0|n)&r)return M=o,0|(A=-1);do{if(!(0|Qe(t,e,A))){if(r){r=(5+(0|i[26352+(n<<2)>>2])-(0|i[A>>2])|0)%5|0;break}r=(6+(0|i[26384+(n<<2)>>2])-(0|i[A>>2])|0)%6|0;break}r=-1}while(0);return A=r,M=o,0|A}(t,s,7&o),-1==(0|o)?(i[n>>2]=0,M=A,0|(s=6)):(0|re(t,s,r)&&x(27795,26932,282,26947),e=0|ln(0|t,0|e,52),I(),e&=15,0|jt(t,s)?Rt(r,e,o,2,n):Gt(r,e,o,2,n),M=A,0|(s=0))):(M=A,0|(s=6))}function Mt(t,e,n,r){e|=0,r|=0;var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=M,M=M+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+A[t>>3],r=+f(+n),n=+h(+n),A[e+16>>3]=n,n=+A[t+8>>3],i=r*+f(+n),A[e>>3]=i,n=r*+h(+n),A[e+8>>3]=n}(t,o),i[e>>2]=0,A[n>>3]=5,r=+Ue(16400,o),r<+A[n>>3]&&(i[e>>2]=0,A[n>>3]=r);r=+Ue(16424,o),r<+A[n>>3]&&(i[e>>2]=1,A[n>>3]=r);r=+Ue(16448,o),r<+A[n>>3]&&(i[e>>2]=2,A[n>>3]=r);r=+Ue(16472,o),r<+A[n>>3]&&(i[e>>2]=3,A[n>>3]=r);r=+Ue(16496,o),r<+A[n>>3]&&(i[e>>2]=4,A[n>>3]=r);r=+Ue(16520,o),r<+A[n>>3]&&(i[e>>2]=5,A[n>>3]=r);r=+Ue(16544,o),r<+A[n>>3]&&(i[e>>2]=6,A[n>>3]=r);r=+Ue(16568,o),r<+A[n>>3]&&(i[e>>2]=7,A[n>>3]=r);r=+Ue(16592,o),r<+A[n>>3]&&(i[e>>2]=8,A[n>>3]=r);r=+Ue(16616,o),r<+A[n>>3]&&(i[e>>2]=9,A[n>>3]=r);r=+Ue(16640,o),r<+A[n>>3]&&(i[e>>2]=10,A[n>>3]=r);r=+Ue(16664,o),r<+A[n>>3]&&(i[e>>2]=11,A[n>>3]=r);r=+Ue(16688,o),r<+A[n>>3]&&(i[e>>2]=12,A[n>>3]=r);r=+Ue(16712,o),r<+A[n>>3]&&(i[e>>2]=13,A[n>>3]=r);r=+Ue(16736,o),r<+A[n>>3]&&(i[e>>2]=14,A[n>>3]=r);r=+Ue(16760,o),r<+A[n>>3]&&(i[e>>2]=15,A[n>>3]=r);r=+Ue(16784,o),r<+A[n>>3]&&(i[e>>2]=16,A[n>>3]=r);r=+Ue(16808,o),r<+A[n>>3]&&(i[e>>2]=17,A[n>>3]=r);r=+Ue(16832,o),r<+A[n>>3]&&(i[e>>2]=18,A[n>>3]=r);if(r=+Ue(16856,o),!(r<+A[n>>3]))return void(M=s);i[e>>2]=19,A[n>>3]=r,M=s}(t|=0,n|=0,c=o),(a=+d(+(1-.5*+A[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(M=o);if(c=0|i[n>>2],s=+ce((s=+A[15920+(24*c|0)>>3])-+ce(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,o=0,s=0;return o=+A[e>>3],r=+f(+o),i=+A[e+8>>3]-+A[t+8>>3],s=r*+h(+i),n=+A[t>>3],+ +_(+s,+(+h(+o)*+f(+n)-+f(+i)*(r*+h(+n))))}(15600+(c<<4)|0,t))),u=0|te(e)?+ce(s+-.3334731722518321):s,s=2.618033988749896*+p(+a),(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}a=+f(+u)*s,A[r>>3]=a,u=+h(+u)*s,A[r+8>>3]=u,M=o}function Ot(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s,a=0,l=0;if(a=+function(t){t|=0;var e=0,n=0;return n=+A[t>>3],e=+A[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),a<1e-16)return e=15600+(e<<4)|0,i[o>>2]=i[e>>2],i[o+4>>2]=i[e+4>>2],i[o+8>>2]=i[e+8>>2],void(i[o+12>>2]=i[e+12>>2]);if(l=+_(+ +A[t+8>>3],+ +A[t>>3]),(0|n)>0){t=0;do{a*=.37796447300922725,t=t+1|0}while((0|t)!=(0|n))}s=.3333333333333333*a,r?(n=!(0|te(n)),a=+y(.381966011250105*(n?s:.37796447300922725*s))):(a=+y(.381966011250105*a),0|te(n)&&(l=+ce(l+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,a=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+u(+(s+-3.141592653589793))<1e-16,e=+A[t>>3],o){e-=n,A[r>>3]=e,o=r;break}if(a=+f(+n),n=+h(+n),e=a*+h(+e)+ +f(+s)*(n*+f(+e)),e=+g(+((e=e>1?1:e)<-1?-1:e)),A[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return A[r>>3]=1.5707963267948966,void(A[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return A[r>>3]=-1.5707963267948966,void(A[r+8>>3]=0);if(c=1/+f(+e),s=n*+h(+s)*c,n=+A[t>>3],e=c*((a-+h(+e)*+h(+n))/+f(+n)),a=s>1?1:s,e=e>1?1:e,(e=+A[t+8>>3]+ +_(+(a<-1?-1:a),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(A[r+8>>3]=e)}e=+A[t>>3]+n,A[r>>3]=e,o=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return A[o>>3]=1.5707963267948966,void(A[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return A[o>>3]=-1.5707963267948966,void(A[r+8>>3]=0);if(e=+A[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);A[r+8>>3]=e}(15600+(e<<4)|0,+ce(+A[15920+(24*e|0)>>3]-l),a,o)}function Pt(t,e,n){e|=0,n|=0;var r,A;r=M,M=M+16|0,st((t|=0)+4|0,A=r),Ot(A,0|i[t>>2],e,0,n),M=r}function Rt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,b,w,E,C,I,S,N,D,L=0,T=0,O=0,P=0,R=0,k=0;if(D=M,M=M+272|0,P=D+240|0,I=D,S=D+224|0,N=D+208|0,y=D+176|0,_=D+160|0,m=D+192|0,v=D+144|0,b=D+128|0,w=D+112|0,E=D+96|0,C=D+80|0,i[(L=D+256|0)>>2]=e,i[P>>2]=i[t>>2],i[P+4>>2]=i[t+4>>2],i[P+8>>2]=i[t+8>>2],i[P+12>>2]=i[t+12>>2],kt(P,L,I),i[o>>2]=0,(0|(P=r+n+(5==(0|r)&1)|0))<=(0|n))M=D;else{a=S+4|0,u=y+4|0,c=n+5|0,l=16880+((s=0|i[L>>2])<<2)|0,f=16960+(s<<2)|0,h=b+8|0,p=w+8|0,d=E+8|0,g=N+4|0,O=n;t:for(;;){T=I+((0|O)%5<<4)|0,i[N>>2]=i[T>>2],i[N+4>>2]=i[T+4>>2],i[N+8>>2]=i[T+8>>2],i[N+12>>2]=i[T+12>>2];do{}while(2==(0|Bt(N,s,0,1)));if((0|O)>(0|n)&!!(0|te(e))){if(i[y>>2]=i[N>>2],i[y+4>>2]=i[N+4>>2],i[y+8>>2]=i[N+8>>2],i[y+12>>2]=i[N+12>>2],st(a,_),r=0|i[y>>2],L=0|i[17040+(80*r|0)+(i[S>>2]<<2)>>2],i[y>>2]=i[18640+(80*r|0)+(20*L|0)>>2],(0|(T=0|i[18640+(80*r|0)+(20*L|0)+16>>2]))>0){t=0;do{mt(u),t=t+1|0}while((0|t)<(0|T))}switch(T=18640+(80*r|0)+(20*L|0)+4|0,i[m>>2]=i[T>>2],i[m+4>>2]=i[T+4>>2],i[m+8>>2]=i[T+8>>2],ct(m,3*(0|i[l>>2])|0),at(u,m,u),ot(u),st(u,v),R=+(0|i[f>>2]),A[b>>3]=3*R,A[h>>3]=0,k=-1.5*R,A[w>>3]=k,A[p>>3]=2.598076211353316*R,A[E>>3]=k,A[d>>3]=-2.598076211353316*R,0|i[17040+(80*(0|i[y>>2])|0)+(i[N>>2]<<2)>>2]){case 1:t=w,r=b;break;case 3:t=E,r=w;break;case 2:t=b,r=E;break;default:t=12;break t}Fe(_,v,r,t,C),Ot(C,0|i[y>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])}if((0|O)<(0|c)&&(st(g,y),Ot(y,0|i[N>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),i[S>>2]=i[N>>2],i[S+4>>2]=i[N+4>>2],i[S+8>>2]=i[N+8>>2],i[S+12>>2]=i[N+12>>2],(0|(O=O+1|0))>=(0|P)){t=3;break}}3!=(0|t)?12==(0|t)&&x(26970,27017,572,27027):M=D}}function kt(t,e,n){t|=0,e|=0,n|=0;var r,A=0,o=0,s=0,a=0,u=0;r=M,M=M+128|0,o=r,a=20240,u=(s=A=r+64|0)+60|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20304,u=(s=o)+60|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));A=(u=!(0|te(0|i[e>>2])))?A:o,Et(o=t+4|0),Ct(o),0|te(0|i[e>>2])&&(yt(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],at(o,A,e=n+4|0),ot(e),i[n+16>>2]=i[t>>2],at(o,A+12|0,e=n+20|0),ot(e),i[n+32>>2]=i[t>>2],at(o,A+24|0,e=n+36|0),ot(e),i[n+48>>2]=i[t>>2],at(o,A+36|0,e=n+52|0),ot(e),i[n+64>>2]=i[t>>2],at(o,A+48|0,n=n+68|0),ot(n),M=r}function Bt(t,e,n,r){n|=0,r|=0;var A,o,s,a,u,c,l=0,f=0,h=0,p=0,d=0;if(c=M,M=M+32|0,u=c+12|0,o=c,d=(t|=0)+4|0,p=0|i[16960+((e|=0)<<2)>>2],p=(a=!!(0|r))?3*p|0:p,l=0|i[d>>2],A=0|i[(s=t+8|0)>>2],a){if((0|(l=A+l+(r=0|i[(f=t+12|0)>>2])|0))==(0|p))return M=c,0|(d=1);h=f}else l=A+l+(r=0|i[(h=t+12|0)>>2])|0;if((0|l)<=(0|p))return M=c,0|(d=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|A)>0){f=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(it(u,p,0,0),ut(d,u,o),vt(o),at(o,u,d),f=r,r=t):(f=r,r=t)}else f=18640+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[f>>2],(0|i[(l=f+16|0)>>2])>0){r=0;do{mt(d),r=r+1|0}while((0|r)<(0|i[l>>2]))}return t=f+4|0,i[u>>2]=i[t>>2],i[u+4>>2]=i[t+4>>2],i[u+8>>2]=i[t+8>>2],e=0|i[16880+(e<<2)>>2],ct(u,a?3*e|0:e),at(d,u,d),ot(d),r=a&&((0|i[s>>2])+(0|i[d>>2])+(0|i[h>>2])|0)==(0|p)?1:2,M=c,0|(d=r)}function Ft(t,e){t|=0,e|=0;var n=0;do{n=0|Bt(t,e,0,1)}while(2==(0|n));return 0|n}function Gt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,b,w,E,C,I=0,S=0,N=0,D=0,L=0;if(C=M,M=M+240|0,v=C+208|0,b=C,w=C+192|0,E=C+176|0,d=C+160|0,g=C+144|0,y=C+128|0,_=C+112|0,m=C+96|0,i[(I=C+224|0)>>2]=e,i[v>>2]=i[t>>2],i[v+4>>2]=i[t+4>>2],i[v+8>>2]=i[t+8>>2],i[v+12>>2]=i[t+12>>2],Ut(v,I,b),i[o>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))M=C;else{a=n+6|0,u=16960+((s=0|i[I>>2])<<2)|0,c=g+8|0,l=y+8|0,f=_+8|0,h=w+4|0,S=0,N=n,r=-1;t:for(;;){if(t=b+((I=(0|N)%6|0)<<4)|0,i[w>>2]=i[t>>2],i[w+4>>2]=i[t+4>>2],i[w+8>>2]=i[t+8>>2],i[w+12>>2]=i[t+12>>2],t=S,S=0|Bt(w,s,0,1),(0|N)>(0|n)&!!(0|te(e))&&(1!=(0|t)&&(0|i[w>>2])!=(0|r))){switch(st(b+((I+5|0)%6<<4)+4|0,E),st(b+(I<<4)+4|0,d),D=+(0|i[u>>2]),A[g>>3]=3*D,A[c>>3]=0,L=-1.5*D,A[y>>3]=L,A[l>>3]=2.598076211353316*D,A[_>>3]=L,A[f>>3]=-2.598076211353316*D,I=0|i[v>>2],0|i[17040+(80*I|0)+(((0|r)==(0|I)?i[w>>2]:r)<<2)>>2]){case 1:t=y,r=g;break;case 3:t=_,r=y;break;case 2:t=g,r=_;break;default:t=8;break t}Fe(E,d,r,t,m),0|Ge(E,m)||0|Ge(d,m)||(Ot(m,0|i[v>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]))}if((0|N)<(0|a)&&(st(h,E),Ot(E,0|i[w>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),(0|(N=N+1|0))>=(0|p)){t=3;break}r=0|i[w>>2]}3!=(0|t)?8==(0|t)&&x(27054,27017,737,27099):M=C}}function Ut(t,e,n){t|=0,e|=0,n|=0;var r,A=0,o=0,s=0,a=0,u=0;r=M,M=M+160|0,o=r,a=20368,u=(s=A=r+80|0)+72|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20448,u=(s=o)+72|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));A=(u=!(0|te(0|i[e>>2])))?A:o,Et(o=t+4|0),Ct(o),0|te(0|i[e>>2])&&(yt(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],at(o,A,e=n+4|0),ot(e),i[n+16>>2]=i[t>>2],at(o,A+12|0,e=n+20|0),ot(e),i[n+32>>2]=i[t>>2],at(o,A+24|0,e=n+36|0),ot(e),i[n+48>>2]=i[t>>2],at(o,A+36|0,e=n+52|0),ot(e),i[n+64>>2]=i[t>>2],at(o,A+48|0,e=n+68|0),ot(e),i[n+80>>2]=i[t>>2],at(o,A+60|0,n=n+84|0),ot(n),M=r}function Qt(t,e){return e=0|ln(0|(t|=0),0|(e|=0),45),I(),127&e}function zt(t,e){t|=0;var n=0,i=0,A=0,o=0;return!0&134217728==(-16777216&(e|=0))?(i=0|ln(0|t,0|e,52),I(),i&=15,n=0|ln(0|t,0|e,45),I(),(n&=127)>>>0>121?0|(t=0):!(613566756&(o=0|fn(0|(A=0|ln(0|t,0|e,0|(o=3*(15^i)|0))),0|I(),0|o))&(0|nn(-1227133514,-1171,0|o,0|(A=0|I()))))&!(4681&A&I())&&15==(0|i)|!(0|(o=0|ln(0|(0|fn(0|~t,0|~e,0|(o=19+(3*i|0)|0))),0|I(),0|o)))&!(0|I())?0|r[20528+n|0]?!(0|t)&!(0|(e&=8191))?0|(o=1):(o=0|hn(0|t,0|e),I(),0|!!((63-o|0)%3|0)):0|(o=1):0|(o=0)):0|(t=0)}function qt(t,e,n,r){t|=0,n|=0,r|=0;var A=0,o=0,s=0,a=0;if(A=0|fn(0|(e|=0),0,52),o=0|I(),n=0|fn(0|n,0,45),n=0|o|I()|134225919,(0|e)<1)return o=-1,r=n,i[(e=t)>>2]=o,void(i[(t=t+4|0)>>2]=r);for(o=1,A=-1;a=0|fn(7,0,0|(s=3*(15-o|0)|0)),n&=~I(),A=A&~a|(s=0|fn(0|r,0,0|s)),n=0|n|I(),(0|o)!=(0|e);)o=o+1|0;i[(s=a=t)>>2]=A,i[(a=a+4|0)>>2]=n}function Vt(t,e,n,r){n|=0,r|=0;var A=0,o=0;if(o=0|ln(0|(t|=0),0|(e|=0),52),I(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return i[r>>2]=t,i[r+4>>2]=e,0|(r=0);if(A=0|fn(0|n,0,52),A|=t,t=I()|-15728641&e,(0|o)>(0|n))do{e=0|fn(7,0,3*(14-n|0)|0),n=n+1|0,A|=e,t=0|I()|t}while((0|n)<(0|o));return i[r>>2]=A,i[r+4>>2]=t,0|(r=0)}function Yt(t,e,n,r){n|=0,r|=0;var A=0,o=0,s=0;if(o=0|ln(0|(t|=0),0|(e|=0),52),I(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);A=n-o|0,n=0|ln(0|t,0|e,45),I();t:do{if(0|z(127&n)){e:do{if(0|o){for(n=1;!((s=0|fn(7,0,3*(15-n|0)|0))&t|0)&!((0|I())&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|Ie(7,0,A,((0|A)<0)<<31>>31),A=0|I();break t}}while(0);n=0|en(0|(n=0|sn(0|(n=0|Ie(7,0,A,((0|A)<0)<<31>>31)),0|I(),5,0)),0|I(),-5,-1),n=0|en(0|(n=0|on(0|n,0|I(),6,0)),0|I(),1,0),A=0|I()}else n=0|Ie(7,0,A,((0|A)<0)<<31>>31),A=0|I()}while(0);return i[(s=r)>>2]=n,i[s+4>>2]=A,0|(s=0)}function jt(t,e){var n=0,r=0,i=0;if(i=0|ln(0|(t|=0),0|(e|=0),45),I(),!(0|z(127&i)))return 0|(i=0);i=0|ln(0|t,0|e,52),I(),i&=15;t:do{if(i)for(r=1;;){if(n=0|ln(0|t,0|e,3*(15-r|0)|0),I(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=1&!(0|n))}function Ht(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,C(0|(n=e)),0|r):(n=0|fn(-1,-1,3+(3*(r-n|0)|0)|0),r=0|fn(0|~n,0|~I(),3*(15-r|0)|0),n=~I()&e,r=~r&t,C(0|n),0|r)}function Xt(t,e,n,r){n|=0,r|=0;var A=0;return A=0|ln(0|(t|=0),0|(e|=0),52),I(),(0|n)<16&(0|(A&=15))<=(0|n)?((0|A)<(0|n)&&(A=0|fn(-1,-1,3+(3*(n+-1-A|0)|0)|0),A=0|fn(0|~A,0|~I(),3*(15-n|0)|0),e=~I()&e,t&=~A),A=0|fn(0|n,0,52),n=-15728641&e|I(),i[r>>2]=t|A,i[r+4>>2]=n,0|(r=0)):0|(r=4)}function Wt(t,e){var n=0,r=0,i=0;if(i=0|ln(0|(t|=0),0|(e|=0),52),I(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|ln(0|t,0|e,3*(15-r|0)|0),I(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function $t(t,e){var n=0,r=0,i=0,A=0,o=0,s=0,a=0;if(a=0|ln(0|(t|=0),0|(e|=0),52),I(),!(a&=15))return a=t,C(0|(s=e)),0|a;for(s=1,n=0;;){r=0|fn(7,0,0|(A=3*(15-s|0)|0)),i=0|I(),o=0|ln(0|t,0|e,0|A),I(),t=(A=0|fn(0|bt(7&o),0,0|A))|t&~r,e=(o=0|I())|e&~i;t:do{if(!n)if(!(A&r|0)&!(o&i|0))n=0;else if(r=0|ln(0|t,0|e,52),I(),r&=15){n=1;e:for(;;){switch(o=0|ln(0|t,0|e,3*(15-n|0)|0),I(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ln(0|t,0|e,0|(o=3*(15-n|0)|0)),I(),A=0|fn(7,0,0|o),e&=~I(),t=t&~A|(o=0|fn(0|bt(7&i),0,0|o)),e=0|e|I(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return C(0|e),0|t}function Kt(t,e){var n=0,r=0,i=0,A=0,o=0;if(r=0|ln(0|(t|=0),0|(e|=0),52),I(),!(r&=15))return r=t,C(0|(n=e)),0|r;for(n=1;o=0|ln(0|t,0|e,0|(A=3*(15-n|0)|0)),I(),i=0|fn(7,0,0|A),e&=~I(),t=(A=0|fn(0|bt(7&o),0,0|A))|t&~i,e=0|I()|e,n>>>0<r>>>0;)n=n+1|0;return C(0|e),0|t}function Jt(t,e){var n=0,r=0,i=0,A=0,o=0,s=0,a=0;if(a=0|ln(0|(t|=0),0|(e|=0),52),I(),!(a&=15))return a=t,C(0|(s=e)),0|a;for(s=1,n=0;;){r=0|fn(7,0,0|(A=3*(15-s|0)|0)),i=0|I(),o=0|ln(0|t,0|e,0|A),I(),t=(A=0|fn(0|wt(7&o),0,0|A))|t&~r,e=(o=0|I())|e&~i;t:do{if(!n)if(!(A&r|0)&!(o&i|0))n=0;else if(r=0|ln(0|t,0|e,52),I(),r&=15){n=1;e:for(;;){switch(o=0|ln(0|t,0|e,3*(15-n|0)|0),I(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(A=0|fn(7,0,0|(i=3*(15-n|0)|0)),o=e&~I(),e=0|ln(0|t,0|e,0|i),I(),t=t&~A|(e=0|fn(0|wt(7&e),0,0|i)),e=0|o|I(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return C(0|e),0|t}function Zt(t,e){var n=0,r=0,i=0,A=0,o=0;if(r=0|ln(0|(t|=0),0|(e|=0),52),I(),!(r&=15))return r=t,C(0|(n=e)),0|r;for(n=1;A=0|fn(7,0,0|(o=3*(15-n|0)|0)),i=e&~I(),e=0|ln(0|t,0|e,0|o),I(),t=(e=0|fn(0|wt(7&e),0,0|o))|t&~A,e=0|I()|i,n>>>0<r>>>0;)n=n+1|0;return C(0|e),0|t}function te(t){return(0|(t|=0))%2|0}function ee(t,e,n){n|=0;var r,A=0;return r=M,M=M+16|0,A=r,(e|=0)>>>0>15?(M=r,0|(A=4)):2146435072&~i[(t|=0)+4>>2]&&2146435072&~i[t+8+4>>2]?(function(t,e,n){var r,i;r=M,M=M+16|0,Mt(t|=0,e|=0,n|=0,i=r),At(i,n+4|0),M=r}(t,e,A),e=0|function(t,e){t|=0;var n,r=0,A=0,o=0,s=0,a=0,u=0,c=0,l=0;if(n=M,M=M+64|0,u=n+40|0,A=n+24|0,o=n+12|0,s=n,fn(0|(e|=0),0,52),r=134225919|I(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(u=0,C(0|(a=0)),M=n,0|u):(fn(0|V(t),0,45),a=0|I()|r,u=-1,C(0|a),M=n,0|u);if(i[u>>2]=i[t>>2],i[u+4>>2]=i[t+4>>2],i[u+8>>2]=i[t+8>>2],i[u+12>>2]=i[t+12>>2],a=u+4|0,(0|e)>0)for(t=-1;i[A>>2]=i[a>>2],i[A+4>>2]=i[a+4>>2],i[A+8>>2]=i[a+8>>2],1&e?(pt(a),i[o>>2]=i[a>>2],i[o+4>>2]=i[a+4>>2],i[o+8>>2]=i[a+8>>2],gt(o)):(dt(a),i[o>>2]=i[a>>2],i[o+4>>2]=i[a+4>>2],i[o+8>>2]=i[a+8>>2],yt(o)),ut(A,o,s),ot(s),c=0|fn(7,0,0|(l=3*(15-e|0)|0)),r&=~I(),t=(l=0|fn(0|lt(s),0,0|l))|t&~c,r=0|I()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[a>>2])<=2&&(0|i[u+8>>2])<=2&&(0|i[u+12>>2])<=2){if(e=0|fn(0|(A=0|V(u)),0,45),e|=t,t=I()|-1040385&r,s=0|Y(u),!(0|z(A))){if((0|s)<=0)break;for(o=0;;){if(A=0|ln(0|e,0|t,52),I(),A&=15)for(r=1;u=0|ln(0|e,0|t,0|(l=3*(15-r|0)|0)),I(),c=0|fn(7,0,0|l),t&=~I(),e=e&~c|(l=0|fn(0|bt(7&u),0,0|l)),t=0|t|I(),r>>>0<A>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|ln(0|e,0|t,52),I(),o&=15;e:do{if(o){r=1;n:for(;;){switch(l=0|ln(0|e,0|t,3*(15-r|0)|0),I(),7&l){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|j(A,0|i[u>>2]))for(r=1;c=0|fn(7,0,0|(u=3*(15-r|0)|0)),l=t&~I(),t=0|ln(0|e,0|t,0|u),I(),e=e&~c|(t=0|fn(0|wt(7&t),0,0|u)),t=0|l|I(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;u=0|ln(0|e,0|t,0|(l=3*(15-r|0)|0)),I(),c=0|fn(7,0,0|l),t&=~I(),e=e&~c|(l=0|fn(0|bt(7&u),0,0|l)),t=0|t|I(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|$t(e,t),t=0|I(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return l=e,C(0|(c=t)),M=n,0|l}(A,e),A=0|I(),i[n>>2]=e,i[n+4>>2]=A,!(0|e)&!(0|A)&&x(27795,27122,1050,27145),M=r,0|(A=0)):(M=r,0|(A=3))}function ne(t,e,n){var r,A=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|ln(0|(t|=0),0|(e|=0),52),I(),o&=15,s=0|ln(0|t,0|e,45),I(),A=!(0|o),0|z(127&s)){if(A)return 0|(s=1);A=1}else{if(A)return 0|(s=0);A=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2])}for(n=1;1&n?gt(r):yt(r),s=0|ln(0|t,0|e,3*(15-n|0)|0),I(),_t(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|A}function re(t,e,n){n|=0;var r,A,o=0,s=0,a=0,u=0,c=0,l=0;if(A=M,M=M+16|0,r=A,l=0|ln(0|(t|=0),0|(e|=0),45),I(),(l&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,M=A,0|(l=5);t:do{if(0|z(l)&&(a=0|ln(0|t,0|e,52),I(),0|(a&=15))){o=1;e:for(;;){switch(c=0|ln(0|t,0|e,3*(15-o|0)|0),I(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<a>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;u=0|fn(7,0,0|(e=3*(15-s|0)|0)),c=o&~I(),o=0|ln(0|t,0|o,0|e),I(),t=t&~u|(o=0|fn(0|wt(7&o),0,0|e)),o=0|c|I(),s>>>0<a>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*l|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|ne(t,o,n)))return M=A,0|(l=0);if(u=n+4|0,i[r>>2]=i[u>>2],i[r+4>>2]=i[u+4>>2],i[r+8>>2]=i[u+8>>2],a=0|ln(0|t,0|o,52),I(),c=15&a,1&a?(yt(u),a=c+1|0):a=c,0|z(l)){t:do{if(c)for(e=1;;){if(s=0|ln(0|t,0|o,3*(15-e|0)|0),I(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Bt(n,a,o,0)){if(0|z(l))do{}while(0|Bt(n,a,0,0));(0|a)!=(0|c)&&dt(u)}else(0|a)!=(0|c)&&(i[u>>2]=i[r>>2],i[u+4>>2]=i[r+4>>2],i[u+8>>2]=i[r+8>>2]);return M=A,0|(l=0)}function ie(t,e,n){n|=0;var r,i,A=0;return i=M,M=M+16|0,0|(A=0|re(t|=0,e|=0,r=i))?(M=i,0|A):(A=0|ln(0|t,0|e,52),I(),Pt(r,15&A,n),M=i,0|(A=0))}function Ae(t,e,n){n|=0;var r,i=0,A=0,o=0;if(r=M,M=M+16|0,0|(i=0|re(t|=0,e|=0,o=r)))return M=r,0|(o=i);i=0|ln(0|t,0|e,45),I(),i=!(0|z(127&i)),A=0|ln(0|t,0|e,52),I(),A&=15;t:do{if(!i){if(0|A)for(i=1;;){if(!(!((0|fn(7,0,3*(15-i|0)|0))&t|0)&!((0|I())&e)))break t;if(!(i>>>0<A>>>0))break;i=i+1|0}return Rt(o,A,0,5,n),M=r,0|0}}while(0);return Gt(o,A,0,6,n),M=r,0|0}function oe(t,e){e|=0;var n=0,r=0,A=0,o=0,s=0,a=0,u=0;if((t|=0)>>>0>15)return 0|(a=4);if(fn(0|t,0,52),a=134225919|I(),!t){n=0,r=0;do{0|z(r)&&(fn(0|r,0,45),s=0|a|I(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|z(s)){for(fn(0|s,0,45),r=1,A=-1,o=0|a|I();A&=~(u=0|fn(7,0,3*(15-r|0)|0)),o&=~I(),(0|r)!=(0|t);)r=r+1|0;i[(u=e+(n<<3)|0)>>2]=A,i[u+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function se(t,e,n,r){t|=0,r|=0;var A=0,o=0,s=0;A=0|ln(0|(e|=0),0|(n|=0),52),I(),!(0|e)&!(0|n)|(0|r)>15|(0|(A&=15))>(0|r)?(o=-1,e=-1,n=0,A=0):(e=0|Ht(e,n,A+1|0,r),s=-15728641&I(),n=0|fn(0|r,0,52),o=A,e=(e=!(0|jt(n|=e,s=0|s|I())))?-1:r,A=s),i[(s=t)>>2]=n,i[s+4>>2]=A,i[t+8>>2]=o,i[t+12>>2]=e}function ae(t,e,n,r){n|=0,r|=0;var A=0,o=0;return A=0|ln(0|(t|=0),0|(e|=0),52),I(),A&=15,i[(o=r+8|0)>>2]=A,!(0|t)&!(0|e)|(0|n)>15|(0|A)>(0|n)?(i[(n=r)>>2]=0,i[n+4>>2]=0,i[o>>2]=-1,void(i[r+12>>2]=-1)):(t=0|Ht(t,e,A+1|0,n),o=-15728641&I(),A=0|fn(0|n,0,52),A|=t,o=0|o|I(),i[(t=r)>>2]=A,i[t+4>>2]=o,t=r+12|0,0|jt(A,o)?void(i[t>>2]=n):void(i[t>>2]=-1))}function ue(t){var e,n=0,r=0,A=0,o=0,s=0,a=0,u=0,c=0;if(!(!(0|(n=0|i[(r=t|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(A=0|ln(0|n,0|r,52),I(),n=0|en(0|(u=0|fn(1,0,3*(15^(A&=15))|0)),0|I(),0|n,0|r),r=0|I(),i[(u=t)>>2]=n,i[u+4>>2]=r,(0|A)<(0|(a=0|i[(u=t+8|0)>>2]))))){for(e=t+12|0,s=A;;){if((0|s)==(0|a)){A=5;break}if(c=(0|s)==(0|i[e>>2]),A=0|ln(0|n,0|r,0|(o=3*(15-s|0)|0)),I(),c&1==(0|(A&=7))&!0){A=7;break}if(!(7==(0|A)&!0)){A=10;break}if(n=0|en(0|n,0|r,0|(c=0|fn(1,0,0|o)),0|I()),r=0|I(),i[(c=t)>>2]=n,i[c+4>>2]=r,!((0|s)>(0|a))){A=10;break}s=s+-1|0}if(5==(0|A))return i[(c=t)>>2]=0,i[c+4>>2]=0,i[u>>2]=-1,void(i[e>>2]=-1);if(7==(0|A))return a=0|en(0|n,0|r,0|(a=0|fn(1,0,0|o)),0|I()),u=0|I(),i[(c=t)>>2]=a,i[c+4>>2]=u,void(i[e>>2]=s+-1)}}function ce(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function le(t,e){return e|=0,+u(+(+A[(t|=0)>>3]-+A[e>>3]))<17453292519943298e-27?0|(e=+u(+(+A[t+8>>3]-+A[e+8>>3]))<17453292519943298e-27):0|(e=0)}function fe(t,e){switch(t=+t,0|(e|=0)){case 1:t=t<0?t+6.283185307179586:t;break;case 2:t=t>0?t+-6.283185307179586:t}return+t}function he(t,e){t|=0;var n,r,i,o=0;return r=+A[(e|=0)>>3],n=+A[t>>3],o=(i=+h(.5*(r-n)))*i+(o=+h(.5*(+A[e+8>>3]-+A[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function pe(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[20656+(t<<3)>>3],0|(e=0))}function de(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|sn(0|(n=0|Ie(7,0,t,((0|t)<0)<<31>>31)),0|I(),120,0),t=0|I(),i[e>>2]=2|n,i[e+4>>2]=t,0|(e=0))}function ge(t,e,n){t|=0,n|=0;var r,i,o,s,a=0,u=0,l=0,d=0,g=0,m=0;return m=+A[(e|=0)>>3],o=+A[t>>3],g=+h(.5*(m-o)),l=+A[e+8>>3],i=+A[t+8>>3],d=+h(.5*(l-i)),r=+f(+o),s=+f(+m),d=2*+_(+ +c(+(d=g*g+d*(s*r*d))),+ +c(+(1-d))),g=+A[n>>3],m=+h(.5*(g-m)),a=+A[n+8>>3],l=+h(.5*(a-l)),u=+f(+g),l=2*+_(+ +c(+(l=m*m+l*(s*u*l))),+ +c(+(1-l))),g=+h(.5*(o-g)),a=+h(.5*(i-a)),a=2*+_(+ +c(+(a=g*g+a*(r*u*a))),+ +c(+(1-a))),4*+y(+ +c(+ +p(.5*(u=.5*(d+l+a)))*+p(.5*(u-d))*+p(.5*(u-l))*+p(.5*(u-a))))}function ye(t,e,n){n|=0;var r,o,s,a=0,u=0;if(s=M,M=M+192|0,o=s,0|(u=0|ie(t|=0,e|=0,r=s+168|0)))return M=s,0|(n=u);if(0|Ae(t,e,o)&&x(27795,27190,415,27199),(0|(e=0|i[o>>2]))>0){if(a=+ge(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{a+=+ge(o+8+((u=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r)}while((0|t)<(0|e))}}else a=0;return A[n>>3]=a,M=s,0|(n=0)}function _e(t){t|=0;var e,n,r=0;return(e=0|tn(1,12))||x(27280,27235,49,27293),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&x(27310,27235,61,27333),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function me(t,e){t|=0,e|=0;var n,r;return(r=0|Je(24))||x(27347,27235,78,27361),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&x(27376,27235,82,27361),i[t>>2]=r,i[e>>2]=r,0|r)}function ve(t){var e=0,n=0,r=0,A=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{A=n,n=0|i[n+16>>2],Ze(A)}while(0|n);A=e,e=0|i[e+8>>2],Ze(A)}while(0|e);if(e=t,t=0|i[t+8>>2],r||Ze(e),!t)break;r=0}}function be(t){var e,n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,I=0,S=0,N=0,D=0,L=0,T=0,M=0,O=0,P=0,R=0,k=0;if(0|i[(a=(t|=0)+8|0)>>2])return 0|(k=1);if(!(s=0|i[t>>2]))return 0|(k=0);r=s,o=0;do{o=o+1|0,r=0|i[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(k=0);(n=0|Je(o<<2))||x(27396,27235,317,27415),(e=0|Je(o<<5))||x(27437,27235,321,27415),i[t>>2]=0,i[(N=t+4|0)>>2]=0,i[a>>2]=0,o=0,P=0,S=0,g=0;t:for(;;){if(d=0|i[s>>2]){c=0,l=d;do{if(h=+A[l+8>>3],r=l,l=0|i[l+16>>2],f=+A[(a=(p=!(0|l))?d:l)+8>>3],+u(+(h-f))>3.141592653589793){k=14;break}c+=(f-h)*(+A[r>>3]+ +A[a>>3])}while(!p);if(14==(0|k)){k=0,c=0,r=d;do{I=+A[r+8>>3],M=0|i[(O=r+16|0)>>2],C=+A[(M=0|M?M:d)+8>>3],c+=(+A[r>>3]+ +A[M>>3])*((C<0?C+6.283185307179586:C)-(I<0?I+6.283185307179586:I)),r=0|i[(0|r?O:s)>>2]}while(0|r)}c>0?(i[n+(P<<2)>>2]=s,P=P+1|0,a=S,r=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!o){if(g){a=N,l=g+8|0,r=s,o=t;break}if(0|i[t>>2]){k=27;break t}a=N,l=t,r=s,o=t;break}if(0|i[(r=o+8|0)>>2]){k=21;break t}if(!(o=0|tn(1,12))){k=23;break t}i[r>>2]=o,a=o+4|0,l=o,r=g}while(0);if(i[l>>2]=s,i[a>>2]=s,l=e+(S<<5)|0,p=0|i[s>>2]){for(A[(d=e+(S<<5)+8|0)>>3]=17976931348623157e292,A[(g=e+(S<<5)+24|0)>>3]=17976931348623157e292,A[l>>3]=-17976931348623157e292,A[(y=e+(S<<5)+16|0)>>3]=-17976931348623157e292,w=17976931348623157e292,E=-17976931348623157e292,a=0,_=p,h=17976931348623157e292,v=17976931348623157e292,b=-17976931348623157e292,f=-17976931348623157e292;c=+A[_>>3],I=+A[_+8>>3],_=0|i[_+16>>2],C=+A[((m=!(0|_))?p:_)+8>>3],c<h&&(A[d>>3]=c,h=c),I<v&&(A[g>>3]=I,v=I),c>b?A[l>>3]=c:c=b,I>f&&(A[y>>3]=I,f=I),w=I>0&I<w?I:w,E=I<0&I>E?I:E,a|=+u(+(I-C))>3.141592653589793,!m;)b=c;a&&(A[y>>3]=E,A[g>>3]=w)}else i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,i[l+12>>2]=0,i[l+16>>2]=0,i[l+20>>2]=0,i[l+24>>2]=0,i[l+28>>2]=0;a=S+1|0}if(s=0|i[(O=s+8|0)>>2],i[O>>2]=0,!s){k=45;break}S=a,g=r}if(21==(0|k))x(27213,27235,35,27247);else if(23==(0|k))x(27267,27235,37,27247);else if(27==(0|k))x(27310,27235,61,27333);else if(45==(0|k)){t:do{if((0|P)>0){for(O=!(0|a),T=a<<2,M=!(0|t),L=0,r=0;;){if(D=0|i[n+(L<<2)>>2],O)k=73;else{if(!(S=0|Je(T))){k=50;break}if(!(N=0|Je(T))){k=52;break}e:do{if(M)o=0;else{for(a=0,o=0,l=t;s=e+(a<<5)|0,0|we(0|i[l>>2],s,0|i[D>>2])?(i[S+(o<<2)>>2]=l,i[N+(o<<2)>>2]=s,m=o+1|0):m=o,l=0|i[l+8>>2];)a=a+1|0,o=m;if((0|m)>0)if(s=0|i[S>>2],1==(0|m))o=s;else for(y=0,_=-1,o=s,g=s;;){for(p=0|i[g>>2],s=0,l=0;d=(0|(a=0|i[i[S+(l<<2)>>2]>>2]))==(0|p)?s:s+(1&we(a,0|i[N+(l<<2)>>2],0|i[p>>2]))|0,(0|(l=l+1|0))!=(0|m);)s=d;if(o=(a=(0|d)>(0|_))?g:o,(0|(s=y+1|0))==(0|m))break e;y=s,_=a?d:_,g=0|i[S+(s<<2)>>2]}else o=0}}while(0);if(Ze(S),Ze(N),o){if(s=0|i[(a=o+4|0)>>2])o=s+8|0;else if(0|i[o>>2]){k=70;break}i[o>>2]=D,i[a>>2]=D}else k=73}if(73==(0|k)){if(k=0,0|(r=0|i[D>>2]))do{N=r,r=0|i[r+16>>2],Ze(N)}while(0|r);Ze(D),r=1}if((0|(L=L+1|0))>=(0|P)){R=r;break t}}50==(0|k)?x(27452,27235,249,27471):52==(0|k)?x(27490,27235,252,27471):70==(0|k)&&x(27310,27235,61,27333)}else R=0}while(0);return Ze(n),Ze(e),0|(k=R)}return 0}function we(t,e,n){t|=0;var r=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;if(!(0|J(e|=0,n|=0)))return 0|(t=0);if(e=0|$(e),r=+A[n>>3],o=e&(o=+A[n+8>>3])<0?o+6.283185307179586:o,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,l=o,n=t;t:for(;;){for(;a=+A[n>>3],o=+A[n+8>>3],f=0|i[(n=n+16|0)>>2],s=+A[(f=0|f?f:t)>>3],u=+A[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(((c=(u=a<0?a+6.283185307179586:a)+(r-s)/(c-s)*((a=o<0?o+6.283185307179586:o)-u))<0?c+6.283185307179586:c)>(l=u==l|a==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,l=o,n=t;t:for(;;){for(;a=+A[n>>3],o=+A[n+8>>3],f=0|i[(n=n+16|0)>>2],s=+A[(f=0|f?f:t)>>3],u=+A[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(a+(r-s)/(c-s)*(o-a)>(l=a==l|o==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function Ee(t,e,n,A,o){n|=0,A|=0,o|=0;var s,a,u,c,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(c=M,M=M+32|0,v=c+16|0,u=c,l=0|ln(0|(t|=0),0|(e|=0),52),I(),l&=15,y=0|ln(0|n,0|A,52),I(),(0|l)!=(15&y))return M=c,0|(v=12);if(d=0|ln(0|t,0|e,45),I(),d&=127,g=0|ln(0|n,0|A,45),I(),d>>>0>121|(g&=127)>>>0>121)return M=c,0|(v=5);if(y=(0|d)!=(0|g)){if(7==(0|(h=0|X(d,g))))return M=c,0|(v=1);7==(0|(p=0|X(g,d)))?x(27514,27538,161,27548):(_=h,f=p)}else _=0,f=0;s=0|z(d),a=0|z(g),i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,i[v+12>>2]=0;do{if(_){if(h=(0|(g=0|i[4272+(28*d|0)+(_<<2)>>2]))>0,a)if(h){d=0,p=n,h=A;do{p=0|Jt(p,h),h=0|I(),1==(0|(f=0|wt(f)))&&(f=0|wt(1)),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=A;else if(h){d=0,p=n,h=A;do{p=0|Zt(p,h),h=0|I(),f=0|wt(f),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=A;if(ne(d,p,v),y||x(27563,27538,191,27548),(h=!!(0|s))&(f=!!(0|a))&&x(27590,27538,192,27548),h){if(7==(0|(f=0|Wt(t,e)))){l=5;break}if(0|r[22e3+(7*f|0)+_|0]){l=1;break}d=p=0|i[21168+(28*f|0)+(_<<2)>>2]}else if(f){if(7==(0|(f=0|Wt(d,p)))){l=5;break}if(0|r[22e3+(7*f|0)+g|0]){l=1;break}d=0,p=0|i[21168+(28*g|0)+(f<<2)>>2]}else d=0,p=0;if((d|p|0)<0)l=5;else{if((0|p)>0){h=v+4|0,f=0;do{vt(h),f=f+1|0}while((0|f)!=(0|p))}if(i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,_t(u,_),0|l)for(;0|te(l)?gt(u):yt(u),(0|l)>1;)l=l+-1|0;if((0|d)>0){l=0;do{vt(u),l=l+1|0}while((0|l)!=(0|d))}at(m=v+4|0,u,m),ot(m),m=51}}else if(ne(n,A,v),!!(0|s)&!!(0|a))if((0|g)!=(0|d)&&x(27621,27538,261,27548),7==(0|(f=0|Wt(t,e)))|7==(0|(l=0|Wt(n,A))))l=5;else if(0|r[22e3+(7*f|0)+l|0])l=1;else if((0|(f=0|i[21168+(28*f|0)+(l<<2)>>2]))>0){h=v+4|0,l=0;do{vt(h),l=l+1|0}while((0|l)!=(0|f));m=51}else m=51;else m=51}while(0);return 51==(0|m)&&(l=v+4|0,i[o>>2]=i[l>>2],i[o+4>>2]=i[l+4>>2],i[o+8>>2]=i[l+8>>2],l=0),M=c,0|(v=l)}function Ce(t,e,n,r){n|=0,r|=0;var A,o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(s=M,M=M+48|0,A=s+36|0,c=s+24|0,l=s+12|0,f=s,a=0|ln(0|(t|=0),0|(e|=0),52),I(),a&=15,p=0|ln(0|t,0|e,45),I(),(p&=127)>>>0>121)return M=s,0|(r=5);if(o=0|z(p),fn(0|a,0,52),y=134225919|I(),i[(u=r)>>2]=-1,i[u+4>>2]=y,!a)return 7==(0|(a=0|lt(n)))||127==(0|(a=0|H(p,a)))?(M=s,0|(y=1)):(d=0|fn(0|a,0,45),g=0|I(),g=-1040385&i[(p=r)+4>>2]|g,i[(y=r)>>2]=i[p>>2]|d,i[y+4>>2]=g,M=s,0|(y=0));for(i[A>>2]=i[n>>2],i[A+4>>2]=i[n+4>>2],i[A+8>>2]=i[n+8>>2],n=a;;){if(u=n,n=n+-1|0,i[c>>2]=i[A>>2],i[c+4>>2]=i[A+4>>2],i[c+8>>2]=i[A+8>>2],0|te(u)){if(0|(a=0|ft(A))){n=13;break}i[l>>2]=i[A>>2],i[l+4>>2]=i[A+4>>2],i[l+8>>2]=i[A+8>>2],gt(l)}else{if(0|(a=0|ht(A))){n=13;break}i[l>>2]=i[A>>2],i[l+4>>2]=i[A+4>>2],i[l+8>>2]=i[A+8>>2],yt(l)}if(ut(c,l,f),ot(f),m=0|i[(a=r)>>2],a=0|i[a+4>>2],_=0|fn(7,0,0|(v=3*(15-u|0)|0)),a&=~I(),v=0|fn(0|lt(f),0,0|v),a=0|I()|a,i[(y=r)>>2]=v|m&~_,i[y+4>>2]=a,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|i[A>>2])<=1&&(0|i[A+4>>2])<=1&&(0|i[A+8>>2])<=1){f=127==(0|(a=0|H(p,n=0|lt(A))))?0:0|z(a);e:do{if(n){if(o){if(7==(0|(a=0|Wt(t,e)))){a=5;break t}if((0|(u=0|i[21376+(28*a|0)+(n<<2)>>2]))>0){a=n,n=0;do{a=0|bt(a),n=n+1|0}while((0|n)!=(0|u))}else a=n;if(1==(0|a)){a=9;break t}127==(0|(n=0|H(p,a)))&&x(27648,27538,411,27678),0|z(n)?x(27693,27538,412,27678):(g=n,d=u,h=a)}else g=a,d=0,h=n;if((0|(l=0|i[4272+(28*p|0)+(h<<2)>>2]))<=-1&&x(27724,27538,419,27678),!f){if((0|d)<0){a=5;break t}if(0|d){a=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];do{n=0|Kt(n,u),u=0|I(),i[(v=r)>>2]=n,i[v+4>>2]=u,a=a+1|0}while((0|a)<(0|d))}if((0|l)<=0){a=g,n=58;break}for(a=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];;)if(n=0|Kt(n,u),u=0|I(),i[(v=r)>>2]=n,i[v+4>>2]=u,(0|(a=a+1|0))==(0|l)){a=g,n=58;break e}}if(7==(0|(c=0|X(g,p)))&&x(27514,27538,428,27678),n=0|i[(a=r)>>2],a=0|i[a+4>>2],(0|l)>0){u=0;do{n=0|Kt(n,a),a=0|I(),i[(v=r)>>2]=n,i[v+4>>2]=a,u=u+1|0}while((0|u)!=(0|l))}if(7==(0|(a=0|Wt(n,a)))&&x(27795,27538,440,27678),n=0|q(g),(0|(n=0|i[(n?21792:21584)+(28*c|0)+(a<<2)>>2]))<0&&x(27795,27538,454,27678),n){a=0,u=0|i[(c=r)>>2],c=0|i[c+4>>2];do{u=0|$t(u,c),c=0|I(),i[(v=r)>>2]=u,i[v+4>>2]=c,a=a+1|0}while((0|a)<(0|n));a=g,n=58}else a=g,n=58}else if(!!(0|o)&!!(0|f)){if(7==(0|(n=0|Wt(t,e)))|7==(0|(u=0|Wt(0|i[(u=r)>>2],0|i[u+4>>2])))){a=5;break t}if((0|(u=0|i[21376+(28*n|0)+(u<<2)>>2]))<0){a=5;break t}if(u){n=0,c=0|i[(l=r)>>2],l=0|i[l+4>>2];do{c=0|Kt(c,l),l=0|I(),i[(v=r)>>2]=c,i[v+4>>2]=l,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&f&&(n=59),59==(0|n)&&1==(0|Wt(0|i[(v=r)>>2],0|i[v+4>>2]))){a=9;break}_=0|i[(v=r)>>2],v=-1040385&i[v+4>>2],m=0|fn(0|a,0,45),v=0|v|I(),i[(a=r)>>2]=_|m,i[a+4>>2]=v,a=0}else a=1}while(0);return M=s,0|(v=a)}function Ie(t,e,n,r){t|=0,e|=0;var i=0,A=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return A=1,C(0|(i=0)),0|A;A=t,i=e,t=1,e=0;do{t=0|sn(0|((o=!0&!(1&n))?1:A),0|(o?0:i),0|t,0|e),e=0|I(),n=0|cn(0|n,0|r,1),r=0|I(),A=0|sn(0|A,0|i,0|A,0|i),i=0|I()}while(!(!(0|n)&!(0|r)));return C(0|e),0|t}function xe(t,e,n,r){n|=0,r|=0;var o,s=0,a=0,u=0,c=0,l=0,h=0;o=M,M=M+16|0,a=o,u=0|ln(0|(t|=0),0|(e|=0),52),I(),u&=15;do{if(u){if(!(s=0|ie(t,e,a))){l=+A[a>>3],c=1/+f(+l),h=+A[25968+(u<<3)>>3],A[n>>3]=l+h,A[n+8>>3]=l-h,l=+A[a+8>>3],c*=h,A[n+16>>3]=c+l,A[n+24>>3]=l-c;break}return M=o,0|(u=s)}if(s=0|ln(0|t,0|e,45),I(),(s&=127)>>>0>121)return M=o,0|(u=5);a=22064+(s<<5)|0,i[n>>2]=i[a>>2],i[n+4>>2]=i[a+4>>2],i[n+8>>2]=i[a+8>>2],i[n+12>>2]=i[a+12>>2],i[n+16>>2]=i[a+16>>2],i[n+20>>2]=i[a+20>>2],i[n+24>>2]=i[a+24>>2],i[n+28>>2]=i[a+28>>2];break}while(0);return function(t,e){e=+e;var n,r,i,o,s,a,u,c=0,l=0;c=(o=+A[(i=16+(t|=0)|0)>>3])-(r=+A[(n=t+24|0)>>3]),c=o<r?c+6.283185307179586:c,l=+A[t>>3],c=.5*(c*e-c),l+=e=.5*((u=l-(a=+A[(s=t+8|0)>>3]))*e-u),A[t>>3]=l>1.5707963267948966?1.5707963267948966:l,e=a-e,A[s>>3]=e<-1.5707963267948966?-1.5707963267948966:e,e=(e=o+c)>3.141592653589793?e+-6.283185307179586:e,A[i>>3]=e<-3.141592653589793?e+6.283185307179586:e,e=(e=r-c)>3.141592653589793?e+-6.283185307179586:e,A[n>>3]=e<-3.141592653589793?e+6.283185307179586:e}(n,r?1.4:1.1),(0|i[(r=26096+(u<<3)|0)>>2])==(0|t)&&(0|i[r+4>>2])==(0|e)&&(A[n>>3]=1.5707963267948966),(0|i[(u=26224+(u<<3)|0)>>2])==(0|t)&&(0|i[u+4>>2])==(0|e)&&(A[n+8>>3]=-1.5707963267948966),1.5707963267948966!=+A[n>>3]&&-1.5707963267948966!=+A[n+8>>3]?(M=o,0|(u=0)):(A[n+16>>3]=3.141592653589793,A[n+24>>3]=-3.141592653589793,M=o,0|(u=0))}function Se(t,e,n,A){t|=0,e|=0,n|=0,A|=0;var o,s,a,u=0,c=0,l=0,f=0;a=M,M=M+48|0,o=a+40|0,s=a,qt(c=a+32|0,0,0,0),l=0|i[c>>2],c=0|i[c+4>>2];do{if(n>>>0<=15){if(0|(u=0|Me(A))){i[(A=s)>>2]=0,i[A+4>>2]=0,i[s+8>>2]=u,i[s+12>>2]=-1,l=s+29|0,i[(A=s+16|0)>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,r[A+12|0]=0,r[l|0]=0|r[o|0],r[l+1|0]=0|r[o+1|0],r[l+2|0]=0|r[o+2|0];break}if(u=0|tn(1+(0|i[e+8>>2])|0,32)){Oe(e,u),i[(f=s)>>2]=l,i[f+4>>2]=c,i[s+8>>2]=0,i[s+12>>2]=n,i[s+16>>2]=A,i[s+20>>2]=e,i[s+24>>2]=u,r[s+28|0]=0,r[(l=s+29|0)|0]=0|r[o|0],r[l+1|0]=0|r[o+1|0],r[l+2|0]=0|r[o+2|0];break}i[(A=s)>>2]=0,i[A+4>>2]=0,i[s+8>>2]=13,i[s+12>>2]=-1,l=s+29|0,i[(A=s+16|0)>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,r[A+12|0]=0,r[l|0]=0|r[o|0],r[l+1|0]=0|r[o+1|0],r[l+2|0]=0|r[o+2|0];break}i[(l=s)>>2]=0,i[l+4>>2]=0,i[s+8>>2]=4,i[s+12>>2]=-1,f=s+29|0,i[(l=s+16|0)>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,r[l+12|0]=0,r[f|0]=0|r[o|0],r[f+1|0]=0|r[o+1|0],r[f+2|0]=0|r[o+2|0]}while(0);Ne(s),i[t>>2]=i[s>>2],i[t+4>>2]=i[s+4>>2],i[t+8>>2]=i[s+8>>2],i[t+12>>2]=i[s+12>>2],i[t+16>>2]=i[s+16>>2],i[t+20>>2]=i[s+20>>2],i[t+24>>2]=i[s+24>>2],i[t+28>>2]=i[s+28>>2],M=a}function Ne(t){var e,n,A,o,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0;if(o=M,M=M+336|0,e=o+168|0,n=o,!(0|(a=0|i[(u=t|=0)>>2]))&!(0|(u=0|i[u+4>>2])))M=o;else{if(0|r[(s=t+28|0)|0]?(a=0|De(a,u),u=0|I()):r[s|0]=1,!(0|i[i[(A=t+20|0)>>2]>>2]))return 0|(a=0|i[(s=t+24|0)>>2])&&Ze(a),i[(w=t)>>2]=0,i[w+4>>2]=0,i[t+8>>2]=0,i[A>>2]=0,i[t+12>>2]=-1,i[t+16>>2]=0,i[s>>2]=0,void(M=o);c=15&(s=0|i[(w=t+16|0)>>2]);t:do{if(!(0|a)&!(0|u))b=t+24|0;else{m=t+12|0,y=3==(0|c),g=255&s,p=3==(1|c),_=t+24|0,d=(c+-1|0)>>>0<3,f=3==(2|c),h=n+8|0;e:for(;;){if(l=0|ln(0|a,0|u,52),I(),(0|(l&=15))==(0|i[m>>2])){switch(15&g){case 0:case 2:case 3:if(0|(c=0|ie(a,u,e))){v=15;break e}if(0|Pe(0|i[A>>2],0|i[_>>2],e)){v=19;break e}}if(p&&(c=0|i[4+(0|i[A>>2])>>2],i[e>>2]=i[c>>2],i[e+4>>2]=i[c+4>>2],i[e+8>>2]=i[c+8>>2],i[e+12>>2]=i[c+12>>2],0|J(26832,e))){if(0|ee(0|i[4+(0|i[A>>2])>>2],l,n)){v=25;break}if((0|i[(c=n)>>2])==(0|a)&&(0|i[c+4>>2])==(0|u)){v=29;break}}if(d){if(0|(c=0|Ae(a,u,e))){v=32;break}if(0|xe(a,u,n,0)){v=36;break}if(f&&0|Re(0|i[A>>2],0|i[_>>2],e,n)){v=42;break}if(p&&0|Be(0|i[A>>2],0|i[_>>2],e,n)){v=42;break}}if(y){if(s=0|xe(a,u,e,1),c=0|i[_>>2],0|s){v=45;break}if(0|Z(c,e)){if(et(n,e),0|tt(e,0|i[_>>2])){v=53;break}if(0|Pe(0|i[A>>2],0|i[_>>2],h)){v=53;break}if(0|Be(0|i[A>>2],0|i[_>>2],n,e)){v=53;break}}}}do{if((0|l)<(0|i[m>>2])){if(s=0|xe(a,u,e,1),c=0|i[_>>2],0|s){v=58;break e}if(!(0|Z(c,e))){v=73;break}if(0|tt(0|i[_>>2],e)&&(et(n,e),0|Re(0|i[A>>2],0|i[_>>2],n,e))){v=65;break e}if(0|(a=0|Xt(a,u,l+1|0,n))){v=67;break e}a=0|i[(u=n)>>2],u=0|i[u+4>>2]}else v=73}while(0);if(73==(0|v)&&(v=0,a=0|De(a,u),u=0|I()),!(0|a)&!(0|u)){b=_;break t}}switch(0|v){case 15:0|(s=0|i[_>>2])&&Ze(s),i[(v=t)>>2]=0,i[v+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=c,v=20;break;case 19:i[t>>2]=a,i[t+4>>2]=u,v=20;break;case 25:x(27795,27761,470,27772);break;case 29:case 42:return i[t>>2]=a,i[t+4>>2]=u,void(M=o);case 32:return 0|(s=0|i[_>>2])&&Ze(s),i[(b=t)>>2]=0,i[b+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=c,void(M=o);case 36:x(27795,27761,493,27772);break;case 45:0|c&&Ze(c),i[(v=t)>>2]=0,i[v+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=s,v=55;break;case 53:i[t>>2]=a,i[t+4>>2]=u,v=55;break;case 58:0|c&&Ze(c),i[(v=t)>>2]=0,i[v+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=s,v=71;break;case 65:i[t>>2]=a,i[t+4>>2]=u,v=71;break;case 67:return 0|(s=0|i[_>>2])&&Ze(s),i[(b=t)>>2]=0,i[b+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=a,void(M=o)}if(20==(0|v))return void(M=o);if(55==(0|v))return void(M=o);if(71==(0|v))return void(M=o)}}while(0);0|(s=0|i[b>>2])&&Ze(s),i[(v=t)>>2]=0,i[v+4>>2]=0,i[t+8>>2]=0,i[A>>2]=0,i[t+12>>2]=-1,i[w>>2]=0,i[b>>2]=0,M=o}}function De(t,e){var n,r=0,A=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;n=M,M=M+16|0,f=n,A=0|ln(0|(t|=0),0|(e|=0),52),I(),A&=15,r=0|ln(0|t,0|e,45),I();do{if(A){for(;r=0|fn(A+4095|0,0,52),o=I()|-15728641&e,r=r|t|(a=0|fn(7,0,0|(s=3*(15-A|0)|0))),o|=u=0|I(),c=0|ln(0|t,0|e,0|s),I(),A=A+-1|0,!((c&=7)>>>0<6);){if(!A){l=4;break}e=o,t=r}if(4==(0|l)){r=0|ln(0|r,0|o,45),I();break}return f=0|fn(((f=!(0|c)&!!(0|jt(r,o)))?2:1)+c|0,0,0|s),l=0|I()|e&~u,f|=t&~a,C(0|l),M=n,0|f}}while(0);return(r&=127)>>>0>120?(f=0,C(0|(l=0)),M=n,0|f):(qt(f,0,r+1|0,0),l=0|i[f+4>>2],f=0|i[f>>2],C(0|l),M=n,0|f)}function Le(t,e,n){t|=0;var r,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if(!(0|J(e|=0,n|=0)))return 0|(p=0);if(e=0|$(e),o=+A[n>>3],s=e&(s=+A[n+8>>3])<0?s+6.283185307179586:s,(0|(p=0|i[t>>2]))<=0)return 0|(p=0);if(r=0|i[t+4>>2],e){e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+A[r+(f<<4)>>3],s=+A[r+(f<<4)+8>>3],a=+A[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+A[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(((l=(c=u<0?u+6.283185307179586:u)+(o-a)/(l-a)*((u=s<0?s+6.283185307179586:s)-c))<0?l+6.283185307179586:l)>(h=c==h|u==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}else{e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+A[r+(f<<4)>>3],s=+A[r+(f<<4)+8>>3],a=+A[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+A[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(u+(o-a)/(l-a)*(s-u)>(h=u==h|s==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}return 0}function Te(t,e){e|=0;var n,r,o,s,a,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(A[(o=e+8|0)>>3]=17976931348623157e292,A[(s=e+24|0)>>3]=17976931348623157e292,A[e>>3]=-17976931348623157e292,A[(a=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],y=17976931348623157e292,_=-17976931348623157e292,m=0,t=-1,h=17976931348623157e292,p=17976931348623157e292,g=-17976931348623157e292,l=-17976931348623157e292,v=0;c=+A[n+(v<<4)>>3],d=+A[n+(v<<4)+8>>3],f=+A[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<h&&(A[o>>3]=c,h=c),d<p&&(A[s>>3]=d,p=d),c>g?A[e>>3]=c:c=g,d>l&&(A[a>>3]=d,l=d),y=d>0&d<y?d:y,_=d<0&d>_?d:_,m|=+u(+(d-f))>3.141592653589793,(0|(t=v+1|0))!=(0|r);)b=v,g=c,v=t,t=b;m&&(A[a>>3]=_,A[s>>3]=y)}}function Me(t){return 0|((t|=0)>>>0<4?0:15)}function Oe(t,e){e|=0;var n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,I=0,x=0;if(_=0|i[(t|=0)>>2]){if(A[(m=e+8|0)>>3]=17976931348623157e292,A[(v=e+24|0)>>3]=17976931348623157e292,A[e>>3]=-17976931348623157e292,A[(b=e+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(s=0|i[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,o=0,r=-1,f=17976931348623157e292,h=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292,w=0;a=+A[s+(w<<4)>>3],p=+A[s+(w<<4)+8>>3],l=+A[s+(((0|(I=r+2|0))==(0|_)?0:I)<<4)+8>>3],a<f&&(A[m>>3]=a,f=a),p<h&&(A[v>>3]=p,h=p),a>d?A[e>>3]=a:a=d,p>c&&(A[b>>3]=p,c=p),g=p>0&p<g?p:g,y=p<0&p>y?p:y,o|=+u(+(p-l))>3.141592653589793,(0|(r=w+1|0))!=(0|_);)I=w,d=a,w=r,r=I;o&&(A[b>>3]=y,A[v>>3]=g)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(I=t+8|0)>>2]))<=0)){n=t+12|0,C=0;do{if(s=0|i[n>>2],o=C,v=e+((C=C+1|0)<<5)|0,b=0|i[s+(o<<3)>>2]){if(A[(w=e+(C<<5)+8|0)>>3]=17976931348623157e292,A[(t=e+(C<<5)+24|0)>>3]=17976931348623157e292,A[v>>3]=-17976931348623157e292,A[(E=e+(C<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(_=0|i[s+(o<<3)+4>>2],g=17976931348623157e292,y=-17976931348623157e292,s=0,o=-1,m=0,f=17976931348623157e292,h=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;a=+A[_+(m<<4)>>3],d=+A[_+(m<<4)+8>>3],l=+A[_+(((0|(o=o+2|0))==(0|b)?0:o)<<4)+8>>3],a<f&&(A[w>>3]=a,f=a),d<h&&(A[t>>3]=d,h=d),a>p?A[v>>3]=a:a=p,d>c&&(A[E>>3]=d,c=d),g=d>0&d<g?d:g,y=d<0&d>y?d:y,s|=+u(+(d-l))>3.141592653589793,(0|(o=m+1|0))!=(0|b);)x=m,m=o,p=a,o=x;s&&(A[E>>3]=y,A[t>>3]=g)}}else i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,i[v+12>>2]=0,i[v+16>>2]=0,i[v+20>>2]=0,i[v+24>>2]=0,i[v+28>>2]=0,r=0|i[I>>2]}while((0|C)<(0|r))}}function Pe(t,e,n){var r=0,A=0,o=0;if(!(0|Le(t|=0,e|=0,n|=0)))return 0|(A=0);if((0|i[(A=t+8|0)>>2])<=0)return 0|(A=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|Le((0|i[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[A>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function Re(t,e,n,r){r|=0;var A,o,s=0,a=0,u=0,c=0,l=0;if(o=M,M=M+16|0,A=o,!(0|Le(t|=0,e|=0,u=(n|=0)+8|0)))return M=o,0|(c=0);c=t+8|0;t:do{if((0|i[c>>2])>0){for(a=t+12|0,s=0;;){if(l=s,s=s+1|0,0|Le((0|i[a>>2])+(l<<3)|0,e+(s<<5)|0,u)){s=0;break}if((0|s)>=(0|i[c>>2]))break t}return M=o,0|s}}while(0);if(0|ke(t,e,n,r))return M=o,0|(l=0);i[A>>2]=i[n>>2],i[A+4>>2]=u,s=0|i[c>>2];t:do{if((0|s)>0)for(t=t+12|0,u=0,a=s;;){if(s=0|i[t>>2],(0|i[s+(u<<3)>>2])>0){if(0|Le(A,r,0|i[s+(u<<3)+4>>2])){s=0;break t}if(s=u+1|0,0|ke((0|i[t>>2])+(u<<3)|0,e+(s<<5)|0,n,r)){s=0;break t}a=0|i[c>>2]}else s=u+1|0;if(!((0|s)<(0|a))){s=1;break}u=s}else s=1}while(0);return M=o,0|(l=s)}function ke(t,e,n,r){t|=0,n|=0;var o,s,a,u,c,l,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,I=0,x=0;if(l=M,M=M+176|0,u=l+172|0,f=l+168|0,c=l,!(0|Z(e|=0,r|=0)))return M=l,0|(t=0);if(function(t,e,n,r){var o,s,a,u,c;e|=0,n|=0,r|=0,t=(s=+A[16+(t|=0)>>3])<(c=+A[t+24>>3]),o=(u=+A[e+16>>3])<(a=+A[e+24>>3]),e=c-u<a-s,i[n>>2]=t?o|e?1:2:0,i[r>>2]=o?t?1:e?2:1:0}(e,r,u,f),yn(0|c,0|n,168),(0|i[n>>2])>0){e=0;do{w=+fe(+A[(I=c+8+(e<<4)+8|0)>>3],0|i[f>>2]),A[I>>3]=w,e=e+1|0}while((0|e)<(0|i[n>>2]))}s=+A[r>>3],a=+A[r+8>>3],w=+fe(+A[r+16>>3],0|i[f>>2]),o=+fe(+A[r+24>>3],0|i[f>>2]);t:do{if((0|i[t>>2])>0){if(r=t+4|0,(0|(f=0|i[c>>2]))<=0)for(e=0;;)if((0|(e=e+1|0))>=(0|i[t>>2])){e=0;break t}for(n=0;;){if(e=0|i[r>>2],v=+A[e+(n<<4)>>3],b=+fe(+A[e+(n<<4)+8>>3],0|i[u>>2]),e=0|i[r>>2],I=(0|(n=n+1|0))%(0|i[t>>2])|0,h=+A[e+(I<<4)>>3],p=+fe(+A[e+(I<<4)+8>>3],0|i[u>>2]),!(v>=s)|!(h>=s)&&!(v<=a)|!(h<=a)&&!(b<=o)|!(p<=o)&&!(b>=w)|!(p>=w)){m=h-v,y=p-b,e=0;do{if(x=e,I=(0|(e=e+1|0))==(0|f)?0:e,h=+A[c+8+(x<<4)+8>>3],p=+A[c+8+(I<<4)+8>>3]-h,d=+A[c+8+(x<<4)>>3],!(0==(_=m*p-y*(g=+A[c+8+(I<<4)>>3]-d))||(E=b-h,C=v-d,g=(E*g-p*C)/_,g<0|g>1))&&(_=(m*E-y*C)/_)>=0&_<=1){e=1;break t}}while((0|e)<(0|f))}if((0|n)>=(0|i[t>>2])){e=0;break}}}else e=0}while(0);return M=l,0|(x=e)}function Be(t,e,n,r){var A=0,o=0,s=0;if(0|ke(t|=0,e|=0,n|=0,r|=0))return 0|(o=1);if((0|i[(o=t+8|0)>>2])<=0)return 0|(o=0);for(A=t+12|0,t=0;;){if(s=t,t=t+1|0,0|ke((0|i[A>>2])+(s<<3)|0,e+(t<<5)|0,n,r)){t=1,A=6;break}if((0|t)>=(0|i[o>>2])){t=0,A=6;break}}return 6==(0|A)?0|t:0}function Fe(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,s,a,u,c,l,f,h=0;u=+A[(t|=0)>>3],a=+A[e>>3]-u,s=+A[t+8>>3],o=+A[e+8>>3]-s,l=+A[n>>3],h=((h=+A[r>>3]-l)*(s-(f=+A[n+8>>3]))-(u-l)*(c=+A[r+8>>3]-f))/(a*c-o*h),A[i>>3]=u+a*h,A[i+8>>3]=s+o*h}function Ge(t,e){return e|=0,+u(+(+A[(t|=0)>>3]-+A[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+A[t+8>>3]-+A[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function Ue(t,e){e|=0;var n,r,i;return+((i=+A[(t|=0)>>3]-+A[e>>3])*i+(r=+A[t+8>>3]-+A[e+8>>3])*r+(n=+A[t+16>>3]-+A[e+16>>3])*n)}function Qe(t,e,n){n|=0;var r,A,o,s,a=0,u=0,c=0,l=0;if(s=M,M=M+32|0,l=s,0|(a=0|re(t|=0,e|=0,A=s+16|0)))return M=s,0|(n=a);r=0|Qt(t,e),o=0|Wt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2]}(r,l),a=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|i[11120+(216*e|0)>>2])!=(0|t))if((0|i[11120+(216*e|0)+8>>2])!=(0|t))if((0|i[11120+(216*e|0)+16>>2])!=(0|t))if((0|i[11120+(216*e|0)+24>>2])!=(0|t))if((0|i[11120+(216*e|0)+32>>2])!=(0|t))if((0|i[11120+(216*e|0)+40>>2])!=(0|t))if((0|i[11120+(216*e|0)+48>>2])!=(0|t))if((0|i[11120+(216*e|0)+56>>2])!=(0|t))if((0|i[11120+(216*e|0)+64>>2])!=(0|t))if((0|i[11120+(216*e|0)+72>>2])!=(0|t))if((0|i[11120+(216*e|0)+80>>2])!=(0|t))if((0|i[11120+(216*e|0)+88>>2])!=(0|t))if((0|i[11120+(216*e|0)+96>>2])!=(0|t))if((0|i[11120+(216*e|0)+104>>2])!=(0|t))if((0|i[11120+(216*e|0)+112>>2])!=(0|t))if((0|i[11120+(216*e|0)+120>>2])!=(0|t))if((0|i[11120+(216*e|0)+128>>2])!=(0|t)){if((0|i[11120+(216*e|0)+136>>2])!=(0|t)){if((0|i[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|i[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|i[A>>2]);do{if(0|z(r)){switch(0|r){case 4:u=0;break;case 14:u=1;break;case 24:u=2;break;case 38:u=3;break;case 49:u=4;break;case 58:u=5;break;case 63:u=6;break;case 72:u=7;break;case 83:u=8;break;case 97:u=9;break;case 107:u=10;break;case 117:u=11;break;default:x(27795,27797,75,27806)}if(c=0|i[26416+(24*u|0)+8>>2],e=0|i[26416+(24*u|0)+16>>2],(0|(t=0|i[A>>2]))!=(0|i[l>>2])&&(l=0|q(r))|(0|(t=0|i[A>>2]))==(0|e)&&(a=(a+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){a=(a+5|0)%6|0;break}5==(0|o)&(0|t)==(0|c)&&(a=(a+1|0)%6|0)}}while(0);return i[n>>2]=a,M=s,0|(n=0)}function ze(t,e,n,r){n|=0,r|=0;var A,o,s,a,u,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(u=M,M=M+32|0,v=u+24|0,a=u+20|0,s=u+8|0,o=u+16|0,A=u,p=(p=!(0|jt(t|=0,e|=0)))?6:5,g=0|ln(0|t,0|e,52),I(),p>>>0<=n>>>0)return M=u,0|(r=2);!(y=!(0|(g&=15)))&&!((_=0|fn(7,0,3*(15^g)|0))&t|0)&!((0|I())&e)?c=n:l=4;t:do{if(4==(0|l)){if((0|((c=!!(0|jt(t,e)))?4:5))<(0|n))return M=u,0|(r=1);if(0|Qe(t,e,v))return M=u,0|(r=1);if(l=(0|i[v>>2])+n|0,7==(0|(_=0|i[(c=c?26704+((0|l)%5<<2)|0:26736+((0|l)%6<<2)|0)>>2])))return M=u,0|(r=1);i[a>>2]=0,c=0|B(t,e,_,a,s);do{if(!c){if(d=0|i[(h=s)>>2],l=(f=(h=0|i[h+4>>2])>>>0<e>>>0|(0|h)==(0|e)&d>>>0<t>>>0)?d:t,f=f?h:e,!y&&!(d&(y=0|fn(7,0,3*(15^g)|0))|0)&!(h&(0|I())))c=n;else{if(h=(n+-1+p|0)%(0|p)|0,c=0|jt(t,e),(0|h)<0&&x(27795,27797,248,27822),(0|((p=!!(0|c))?4:5))<(0|h)&&x(27795,27797,248,27822),0|Qe(t,e,v)&&x(27795,27797,248,27822),c=(0|i[v>>2])+h|0,7==(0|(h=0|i[(c=p?26704+((0|c)%5<<2)|0:26736+((0|c)%6<<2)|0)>>2]))&&x(27795,27797,248,27822),i[o>>2]=0,0|(c=0|B(t,e,h,o,A)))break;p=0|i[(d=A)>>2],d=0|i[d+4>>2];do{if(d>>>0<f>>>0|(0|d)==(0|f)&p>>>0<l>>>0){if(l=0|jt(p,d)?0|U(p,d,t,e):0|i[26800+(((0|i[o>>2])+(0|i[26768+(h<<2)>>2])|0)%6<<2)>>2],c=0|jt(p,d),(l+-1|0)>>>0>5){c=-1,l=p,f=d;break}if(1==(0|l)&(c=!!(0|c))){c=-1,l=p,f=d;break}do{if(!(0|Qe(p,d,v))){if(c){c=(5+(0|i[26352+(l<<2)>>2])-(0|i[v>>2])|0)%5|0;break}c=(6+(0|i[26384+(l<<2)>>2])-(0|i[v>>2])|0)%6|0;break}c=-1}while(0);l=p,f=d}else c=n}while(0);d=0|i[(h=s)>>2],h=0|i[h+4>>2]}if((0|l)==(0|d)&(0|f)==(0|h)){if(t=(p=!!(0|jt(d,h)))?0|U(d,h,t,e):0|i[26800+(((0|i[a>>2])+(0|i[26768+(_<<2)>>2])|0)%6<<2)>>2],c=0|jt(d,h),(t+-1|0)>>>0<=5&&!(1==(0|t)&(m=!!(0|c))))do{if(!(0|Qe(d,h,v))){if(m){c=(5+(0|i[26352+(t<<2)>>2])-(0|i[v>>2])|0)%5|0;break}c=(6+(0|i[26384+(t<<2)>>2])-(0|i[v>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|p&5==(0|c)?0:c}e=f,t=l;break t}}while(0);return M=u,0|(r=c)}}while(0);return m=0|fn(0|c,0,56),v=I()|-2130706433&e|536870912,i[r>>2]=m|t,i[r+4>>2]=v,M=u,0|(r=0)}function qe(t,e){t|=0;var n,r,A=0,o=0;return r=M,M=M+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|zt(t,A=-2130706433&e|134217728)?(o=0|ln(0|t,0|e,56),I(),A=(o=!(0|ze(t,A,7&o,n)))&((0|i[(A=n)>>2])==(0|t)?(0|i[A+4>>2])==(0|e):0)&1,M=r,0|A):(M=r,0|(A=0))}function Ve(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|tn(e,4),i[t>>2]=r,r||x(27835,27858,40,27872)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function Ye(t){var e,n,r,o=0,s=0,a=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(a=0|i[t>>2],c=0|i[a+(o<<2)>>2])break;o=o+1|0}o=a+(~~(+u(+ +l(10,+ +(15-(0|i[n>>2])|0))*(+A[c>>3]+ +A[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[o>>2];e:do{if(0|s){if(a=c+32|0,(0|s)==(0|c))i[o>>2]=i[a>>2];else{if(!(o=0|i[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|i[(s=o+32|0)>>2]))break e;i[s>>2]=i[a>>2]}Ze(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Ze(0|i[t>>2])}function je(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function He(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|i[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){i[r+32>>2]=i[s>>2];break}if(10==(0|o))return 0|n}else i[n>>2]=i[s>>2]}while(0);return Ze(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function Xe(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,a=0;(r=0|Je(40))||x(27888,27858,98,27901),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|i[t+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,o=0|i[s>>2];do{if(o){for(;!(0|le(o,e)&&0|le(o+16|0,n));)if(s=0|i[o+32>>2],!(0|i[(o=0|s?s:o)+32>>2])){a=10;break}if(10==(0|a)){i[o+32>>2]=r;break}return Ze(r),0|(a=o)}i[s>>2]=r}while(0);return i[(a=t+8|0)>>2]=1+(0|i[a>>2]),0|(a=r)}function We(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(o=0|i[(0|i[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|le(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|le(t,e)&&0|le(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function $e(t,e){e|=0;var n=0;if(n=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|le(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ke(t){return 0|+mn(+(t=+t))}function Je(t){t|=0;var e,n=0,r=0,A=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0;e=M,M=M+16|0,p=e;do{if(t>>>0<245){if(t=(l=t>>>0<11?16:t+11&-8)>>>3,3&(r=(h=0|i[6981])>>>t))return A=0|i[(r=(t=27964+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(o=A+8|0)>>2]))==(0|t)?i[6981]=h&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),w=n<<3,i[A+4>>2]=3|w,i[(w=A+w+4|0)>>2]=1|i[w>>2],M=e,0|(w=o);if(l>>>0>(f=0|i[6983])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=27964+((A=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(A=(n>>>=t)>>>1&1))+(n>>>A)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(u=s+8|0)>>2]))==(0|n)?(t=h&~(1<<A),i[6981]=t):(i[r+12>>2]=n,i[t>>2]=r,t=h),a=(w=A<<3)-l|0,i[s+4>>2]=3|l,i[(o=s+l|0)+4>>2]=1|a,i[s+w>>2]=a,0|f&&(A=0|i[6986],r=27964+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=A,i[n+12>>2]=A,i[A+8>>2]=n,i[A+12>>2]=r),i[6983]=a,i[6986]=o,M=e,0|(w=u);if(s=0|i[6982]){for(r=(s&0-s)-1|0,r=c=0|i[28228+(((A=(r>>>=o=r>>>12&16)>>>5&8)|o|(a=(r>>>=A)>>>2&4)|(u=(r>>>=a)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&i[c+4>>2])-l|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,u=(o=(a=(-8&i[t+4>>2])-l|0)>>>0<c>>>0)?t:u,c=o?a:c;if((a=u+l|0)>>>0>u>>>0){o=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(t=u+20|0)>>2])&&!(n=0|i[(t=u+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(A=n+20|0)>>2])n=r,t=A;else{if(!(r=0|i[(A=n+16|0)>>2]))break;n=r,t=A}i[t>>2]=0,r=n}else r=0|i[u+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|i[u+28>>2],(0|u)==(0|i[(t=28228+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[6982]=s&~(1<<n);break}}else if(i[((0|i[(w=o+16|0)>>2])==(0|u)?w:o+20)>>2]=r,!r)break;i[r+24>>2]=o,0|(n=0|i[u+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[u+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(w=c+l|0,i[u+4>>2]=3|w,i[(w=u+w+4|0)>>2]=1|i[w>>2]):(i[u+4>>2]=3|l,i[a+4>>2]=1|c,i[a+c>>2]=c,0|f&&(A=0|i[6986],r=27964+((n=f>>>3)<<1<<2)|0,(n=1<<n)&h?n=0|i[(t=r+8|0)>>2]:(i[6981]=n|h,n=r,t=r+8|0),i[t>>2]=A,i[n+12>>2]=A,i[A+8>>2]=n,i[A+12>>2]=r),i[6983]=c,i[6986]=a),M=e,0|(w=u+8|0)}h=l}else h=l}else h=l}else if(t>>>0<=4294967231)if(l=-8&(t=t+11|0),A=0|i[6982]){o=0-l|0,c=(t>>>=8)?l>>>0>16777215?31:l>>>((c=14-((u=((y=t<<(h=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|h|(c=((y<<=u)+245760|0)>>>16&2))+(y<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[28228+(c<<2)>>2];t:do{if(r)for(t=0,u=l<<(31==(0|c)?0:25-(c>>>1)|0),s=0;;){if((a=(-8&i[r+4>>2])-l|0)>>>0<o>>>0){if(!a){t=r,o=0,y=65;break t}t=r,o=a}if(s=!(0|(y=0|i[r+20>>2]))|(0|y)==(0|(r=0|i[r+16+(u>>>31<<2)>>2]))?s:y,!r){r=s,y=61;break}u<<=1}else r=0,t=0,y=61}while(0);if(61==(0|y)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&A)){h=l;break}h=(t&0-t)-1|0,t=0,r=0|i[28228+(((s=(h>>>=a=h>>>12&16)>>>5&8)|a|(u=(h>>>=s)>>>2&4)|(c=(h>>>=u)>>>1&2)|(r=(h>>>=c)>>>1&1))+(h>>>r)<<2)>>2]}r?y=65:(u=t,a=o)}if(65==(0|y))for(s=r;;){if(o=(r=(h=(-8&i[s+4>>2])-l|0)>>>0<o>>>0)?h:o,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){u=t,a=o;break}s=r}if(0|u&&a>>>0<((0|i[6983])-l|0)>>>0&&(f=u+l|0)>>>0>u>>>0){s=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(t=u+20|0)>>2])&&!(n=0|i[(t=u+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0}else w=0|i[u+8>>2],i[w+12>>2]=n,i[n+8>>2]=w}while(0);do{if(s){if(t=0|i[u+28>>2],(0|u)==(0|i[(r=28228+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){A&=~(1<<t),i[6982]=A;break}}else if(i[((0|i[(w=s+16|0)>>2])==(0|u)?w:s+20)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[u+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[u+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(a>>>0<16)w=a+l|0,i[u+4>>2]=3|w,i[(w=u+w+4|0)>>2]=1|i[w>>2];else{if(i[u+4>>2]=3|l,i[f+4>>2]=1|a,i[f+a>>2]=a,n=a>>>3,a>>>0<256){r=27964+(n<<1<<2)|0,(t=0|i[6981])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=f,i[n+12>>2]=f,i[f+8>>2]=n,i[f+12>>2]=r;break}if(n=28228+((r=(n=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((v=((w=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(r=((w<<=v)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[f+28>>2]=r,i[(t=f+16|0)+4>>2]=0,i[t>>2]=0,!(A&(t=1<<r))){i[6982]=A|t,i[n>>2]=f,i[f+24>>2]=n,i[f+12>>2]=f,i[f+8>>2]=f;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2])!=(0|a)){for(A=a<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(r=n+16+(A>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|a)){n=t;break e}A<<=1,n=t}i[r>>2]=f,i[f+24>>2]=n,i[f+12>>2]=f,i[f+8>>2]=f;break t}}while(0);w=0|i[(b=n+8|0)>>2],i[w+12>>2]=f,i[b>>2]=f,i[f+8>>2]=w,i[f+12>>2]=n,i[f+24>>2]=0}}while(0);return M=e,0|(w=u+8|0)}h=l}else h=l;else h=-1}while(0);if((r=0|i[6983])>>>0>=h>>>0)return n=r-h|0,t=0|i[6986],n>>>0>15?(w=t+h|0,i[6986]=w,i[6983]=n,i[w+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|h):(i[6983]=0,i[6986]=0,i[t+4>>2]=3|r,i[(w=t+r+4|0)>>2]=1|i[w>>2]),M=e,0|(w=t+8|0);if((a=0|i[6984])>>>0>h>>>0)return v=a-h|0,i[6984]=v,b=(w=0|i[6987])+h|0,i[6987]=b,i[b+4>>2]=1|v,i[w+4>>2]=3|h,M=e,0|(w=w+8|0);if(0|i[7099]?t=0|i[7101]:(i[7101]=4096,i[7100]=4096,i[7102]=-1,i[7103]=-1,i[7104]=0,i[7092]=0,i[7099]=-16&p^1431655768,t=4096),u=h+48|0,(l=(s=t+(c=h+47|0)|0)&(o=0-t|0))>>>0<=h>>>0)return M=e,0|(w=0);if(0|(t=0|i[7091])&&(p=(f=0|i[7089])+l|0)>>>0<=f>>>0|p>>>0>t>>>0)return M=e,0|(w=0);t:do{if(4&i[7092])n=0,y=143;else{r=0|i[6987];e:do{if(r){for(A=28372;!((p=0|i[A>>2])>>>0<=r>>>0&&(p+(0|i[A+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[A+8>>2])){y=128;break e}A=t}if((n=s-a&o)>>>0<2147483647)if((0|(t=0|vn(0|n)))==((0|i[A>>2])+(0|i[A+4>>2])|0)){if(-1!=(0|t)){a=n,s=t,y=145;break t}}else A=t,y=136;else n=0}else y=128}while(0);do{if(128==(0|y))if(-1!=(0|(r=0|vn(0)))&&(n=r,g=(n=((g=(d=0|i[7100])+-1|0)&n|0?(g+n&0-d)-n|0:0)+l|0)+(d=0|i[7089])|0,n>>>0>h>>>0&n>>>0<2147483647)){if(0|(p=0|i[7091])&&g>>>0<=d>>>0|g>>>0>p>>>0){n=0;break}if((0|(t=0|vn(0|n)))==(0|r)){a=n,s=r,y=145;break t}A=t,y=136}else n=0}while(0);do{if(136==(0|y)){if(r=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|A))){if(-1==(0|A)){n=0;break}a=n,s=A,y=145;break t}if((t=c-n+(t=0|i[7101])&0-t)>>>0>=2147483647){a=n,s=A,y=145;break t}if(-1==(0|vn(0|t))){vn(0|r),n=0;break}a=t+n|0,s=A,y=145;break t}}while(0);i[7092]=4|i[7092],y=143}}while(0);if(143==(0|y)&&l>>>0<2147483647&&!(-1==(0|(v=0|vn(0|l)))|1^(m=(_=(g=0|vn(0))-v|0)>>>0>(h+40|0)>>>0)|v>>>0<g>>>0&-1!=(0|v)&-1!=(0|g)^1)&&(a=m?_:n,s=v,y=145),145==(0|y)){n=(0|i[7089])+a|0,i[7089]=n,n>>>0>(0|i[7090])>>>0&&(i[7090]=n),c=0|i[6987];t:do{if(c){for(n=28372;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){y=154;break}if(!(A=0|i[n+8>>2]))break;n=A}if(!(154!=(0|y)||(b=n+4|0,8&i[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[b>>2]=r+a,b=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(w=(0|i[6984])+a|0)-v|0,i[6987]=b,i[6984]=v,i[b+4>>2]=1|v,i[c+w+4>>2]=40,i[6988]=i[7103];break}for(s>>>0<(0|i[6985])>>>0&&(i[6985]=s),r=s+a|0,n=28372;;){if((0|i[n>>2])==(0|r)){y=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|y)&&!(8&i[n+12>>2])){i[n>>2]=s,i[(f=n+4|0)>>2]=(0|i[f>>2])+a,l=(f=s+(7&(f=s+8|0)?0-f&7:0)|0)+h|0,u=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-f-h|0,i[f+4>>2]=3|h;e:do{if((0|c)==(0|n))w=(0|i[6984])+u|0,i[6984]=w,i[6987]=l,i[l+4>>2]=1|w;else{if((0|i[6986])==(0|n)){w=(0|i[6983])+u|0,i[6983]=w,i[6986]=l,i[l+4>>2]=1|w,i[l+w>>2]=w;break}if(1==(3&(t=0|i[n+4>>2]))){a=-8&t,A=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[6981]=i[6981]&~(1<<A);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(A=(r=n+16|0)+4|0)>>2])r=A;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(A=0|i[(o=t+20|0)>>2])t=A,r=o;else{if(!(A=0|i[(o=t+16|0)>>2]))break;t=A,r=o}i[r>>2]=0}else w=0|i[n+8>>2],i[w+12>>2]=t,i[t+8>>2]=w}while(0);if(!s)break;A=28228+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[A>>2])==(0|n)){if(i[A>>2]=t,0|t)break;i[6982]=i[6982]&~(1<<r);break n}if(i[((0|i[(w=s+16|0)>>2])==(0|n)?w:s+20)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(A=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=A,i[A+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+a|0,o=a+u|0}else o=u;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[l+4>>2]=1|o,i[l+o>>2]=o,n=o>>>3,o>>>0<256){r=27964+(n<<1<<2)|0,(t=0|i[6981])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=l,i[n+12>>2]=l,i[l+8>>2]=n,i[l+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){A=31;break}A=o>>>((A=14-((v=((w=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(A=((w<<=v)+245760|0)>>>16&2))+(w<<A>>>15)|0)+7|0)&1|A<<1}else A=0}while(0);if(n=28228+(A<<2)|0,i[l+28>>2]=A,i[(t=l+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[6982])&(r=1<<A))){i[6982]=t|r,i[n>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|o)){for(A=o<<(31==(0|A)?0:25-(A>>>1)|0);t=0|i[(r=n+16+(A>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|o)){n=t;break n}A<<=1,n=t}i[r>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break e}}while(0);w=0|i[(b=n+8|0)>>2],i[w+12>>2]=l,i[b>>2]=l,i[l+8>>2]=w,i[l+12>>2]=n,i[l+24>>2]=0}}while(0);return M=e,0|(w=f+8|0)}for(n=28372;!((t=0|i[n>>2])>>>0<=c>>>0&&(w=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(o=w+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,b=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(r=a+-40|0)-v|0,i[6987]=b,i[6984]=v,i[b+4>>2]=1|v,i[s+r+4>>2]=40,i[6988]=i[7103],i[(r=t+4|0)>>2]=27,i[n>>2]=i[7093],i[n+4>>2]=i[7094],i[n+8>>2]=i[7095],i[n+12>>2]=i[7096],i[7093]=s,i[7094]=a,i[7096]=0,i[7095]=n,n=t+24|0;do{b=n,i[(n=n+4|0)>>2]=7}while((b+8|0)>>>0<w>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=27964+(n<<1<<2)|0,(t=0|i[6981])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=28228+((A=(n=s>>>8)?s>>>0>16777215?31:s>>>((A=14-((v=((w=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(A=((w<<=v)+245760|0)>>>16&2))+(w<<A>>>15)|0)+7|0)&1|A<<1:0)<<2)|0,i[c+28>>2]=A,i[c+20>>2]=0,i[o>>2]=0,!((n=0|i[6982])&(t=1<<A))){i[6982]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2])!=(0|s)){for(A=s<<(31==(0|A)?0:25-(A>>>1)|0);t=0|i[(r=n+16+(A>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){n=t;break e}A<<=1,n=t}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);w=0|i[(b=n+8|0)>>2],i[w+12>>2]=c,i[b>>2]=c,i[c+8>>2]=w,i[c+12>>2]=n,i[c+24>>2]=0}}else!(0|(w=0|i[6985]))|s>>>0<w>>>0&&(i[6985]=s),i[7093]=s,i[7094]=a,i[7096]=0,i[6990]=i[7099],i[6989]=-1,i[6994]=27964,i[6993]=27964,i[6996]=27972,i[6995]=27972,i[6998]=27980,i[6997]=27980,i[7e3]=27988,i[6999]=27988,i[7002]=27996,i[7001]=27996,i[7004]=28004,i[7003]=28004,i[7006]=28012,i[7005]=28012,i[7008]=28020,i[7007]=28020,i[7010]=28028,i[7009]=28028,i[7012]=28036,i[7011]=28036,i[7014]=28044,i[7013]=28044,i[7016]=28052,i[7015]=28052,i[7018]=28060,i[7017]=28060,i[7020]=28068,i[7019]=28068,i[7022]=28076,i[7021]=28076,i[7024]=28084,i[7023]=28084,i[7026]=28092,i[7025]=28092,i[7028]=28100,i[7027]=28100,i[7030]=28108,i[7029]=28108,i[7032]=28116,i[7031]=28116,i[7034]=28124,i[7033]=28124,i[7036]=28132,i[7035]=28132,i[7038]=28140,i[7037]=28140,i[7040]=28148,i[7039]=28148,i[7042]=28156,i[7041]=28156,i[7044]=28164,i[7043]=28164,i[7046]=28172,i[7045]=28172,i[7048]=28180,i[7047]=28180,i[7050]=28188,i[7049]=28188,i[7052]=28196,i[7051]=28196,i[7054]=28204,i[7053]=28204,i[7056]=28212,i[7055]=28212,b=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(w=a+-40|0)-v|0,i[6987]=b,i[6984]=v,i[b+4>>2]=1|v,i[s+w+4>>2]=40,i[6988]=i[7103]}while(0);if((n=0|i[6984])>>>0>h>>>0)return v=n-h|0,i[6984]=v,b=(w=0|i[6987])+h|0,i[6987]=b,i[b+4>>2]=1|v,i[w+4>>2]=3|h,M=e,0|(w=w+8|0)}return i[(w=27920)>>2]=12,M=e,0|(w=0)}function Ze(t){var e=0,n=0,r=0,A=0,o=0,s=0,a=0,u=0;if(t|=0){n=t+-8|0,A=0|i[6985],u=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)a=n,s=n;else{if(r=0|i[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<A>>>0)return;if((0|i[6986])==(0|s)){if(3&~(e=0|i[(t=u+4|0)>>2])){a=s,e=o;break}return i[6983]=o,i[t>>2]=-2&e,i[s+4>>2]=1|o,void(i[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[6981]=i[6981]&~(1<<n),a=s,e=o;break}i[t+12>>2]=e,i[e+8>>2]=t,a=s,e=o;break}A=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else a=0|i[s+8>>2],i[a+12>>2]=t,i[t+8>>2]=a}while(0);if(A){if(e=0|i[s+28>>2],(0|i[(n=28228+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[6982]=i[6982]&~(1<<e),a=s,e=o;break}}else if(i[((0|i[(a=A+16|0)>>2])==(0|s)?a:A+20)>>2]=t,!t){a=s,e=o;break}i[t+24>>2]=A,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,a=s,e=o):(a=s,e=o)}else a=s,e=o}}while(0);if(!(s>>>0>=u>>>0)&&1&(r=0|i[(t=u+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[a+4>>2]=1|e,i[s+e>>2]=e,A=e;else{if((0|i[6987])==(0|u)){if(u=(0|i[6984])+e|0,i[6984]=u,i[6987]=a,i[a+4>>2]=1|u,(0|a)!=(0|i[6986]))return;return i[6986]=0,void(i[6983]=0)}if((0|i[6986])==(0|u))return u=(0|i[6983])+e|0,i[6983]=u,i[6986]=s,i[a+4>>2]=1|u,void(i[s+u>>2]=u);A=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[u+8>>2],(0|(t=0|i[u+12>>2]))==(0|e)){i[6981]=i[6981]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}o=0|i[u+24>>2],t=0|i[u+12>>2];do{if((0|t)==(0|u)){if(t=0|i[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[u+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|i[u+28>>2],(0|i[(e=28228+(t<<2)|0)>>2])==(0|u)){if(i[e>>2]=n,!n){i[6982]=i[6982]&~(1<<t);break}}else if(i[((0|i[(r=o+16|0)>>2])==(0|u)?r:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[(t=u+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[a+4>>2]=1|A,i[s+A>>2]=A,(0|a)==(0|i[6986]))return void(i[6983]=A)}if(t=A>>>3,A>>>0<256)return n=27964+(t<<1<<2)|0,(e=0|i[6981])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[6981]=e|t,t=n,e=n+8|0),i[e>>2]=a,i[t+12>>2]=a,i[a+8>>2]=t,void(i[a+12>>2]=n);t=28228+((r=(t=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((o=((u=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((u<<=o)+245760|0)>>>16&2))+(u<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[a+28>>2]=r,i[a+20>>2]=0,i[a+16>>2]=0,e=0|i[6982],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2])!=(0|A)){for(r=A<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|A)){t=e;break e}r<<=1,t=e}i[n>>2]=a,i[a+24>>2]=t,i[a+12>>2]=a,i[a+8>>2]=a;break t}}while(0);u=0|i[(s=t+8|0)>>2],i[u+12>>2]=a,i[s>>2]=a,i[a+8>>2]=u,i[a+12>>2]=t,i[a+24>>2]=0}else i[6982]=e|n,i[t>>2]=a,i[a+24>>2]=t,i[a+12>>2]=a,i[a+8>>2]=a}while(0);if(u=(0|i[6989])-1|0,i[6989]=u,!(0|u)){for(t=28380;t=0|i[t>>2];)t=t+8|0;i[6989]=-1}}}}function tn(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Je(n))&&3&i[t+-4>>2]?(_n(0|t,0,0|n),0|t):0|t}function en(t,e,n,r){return 0|(C((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function nn(t,e,n,r){return 0|(C(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function rn(t){return 0|((t|=0)?31-(0|E(t^t-1)):32)}function An(t,e,n,r,A){A|=0;var o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(l=t|=0,s=n|=0,a=h=r|=0,!(c=u=e|=0))return o=!!(0|A),a?o?(i[A>>2]=0|t,i[A+4>>2]=0&e,A=0,0|(C(0|(h=0)),A)):(A=0,0|(C(0|(h=0)),A)):(o&&(i[A>>2]=(l>>>0)%(s>>>0),i[A+4>>2]=0),A=(l>>>0)/(s>>>0)>>>0,0|(C(0|(h=0)),A));o=!(0|a);do{if(s){if(!o){if((o=(0|E(0|a))-(0|E(0|c))|0)>>>0<=31){s=f=o+1|0,t=l>>>(f>>>0)&(e=o-31>>31)|c<<(a=31-o|0),e&=c>>>(f>>>0),o=0,a=l<<a;break}return A?(i[A>>2]=0|t,i[A+4>>2]=u|0&e,A=0,0|(C(0|(h=0)),A)):(A=0,0|(C(0|(h=0)),A))}if((o=s-1|0)&s|0){s=a=33+(0|E(0|s))-(0|E(0|c))|0,t=(f=32-a|0)-1>>31&c>>>((p=a-32|0)>>>0)|(c<<f|l>>>(a>>>0))&(e=p>>31),e&=c>>>(a>>>0),o=l<<(d=64-a|0)&(u=f>>31),a=(c<<d|l>>>(p>>>0))&u|l<<f&a-33>>31;break}return 0|A&&(i[A>>2]=o&l,i[A+4>>2]=0),1==(0|s)?(d=0|t,0|(C(0|(p=u|0&e)),d)):(p=c>>>((d=0|rn(0|s))>>>0)|0,d=c<<32-d|l>>>(d>>>0),0|(C(0|p),d))}if(o)return 0|A&&(i[A>>2]=(c>>>0)%(s>>>0),i[A+4>>2]=0),d=(c>>>0)/(s>>>0)>>>0,0|(C(0|(p=0)),d);if(!l)return 0|A&&(i[A>>2]=0,i[A+4>>2]=(c>>>0)%(a>>>0)),d=(c>>>0)/(a>>>0)>>>0,0|(C(0|(p=0)),d);if(!((o=a-1|0)&a))return 0|A&&(i[A>>2]=0|t,i[A+4>>2]=o&c|0&e),p=0,d=c>>>((0|rn(0|a))>>>0),0|(C(0|p),d);if((o=(0|E(0|a))-(0|E(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(a=31-o|0)|l>>>(e>>>0),e=c>>>(e>>>0),o=0,a=l<<a;break}return A?(i[A>>2]=0|t,i[A+4>>2]=u|0&e,d=0,0|(C(0|(p=0)),d)):(d=0,0|(C(0|(p=0)),d))}while(0);if(s){c=0|en(0|(f=0|n),0|(l=h|0&r),-1,-1),n=0|I(),u=a,a=0;do{r=u,u=o>>>31|u<<1,o=a|o<<1,nn(0|c,0|n,0|(r=t<<1|r>>>31),0|(h=t>>>31|e<<1)),a=1&(p=(d=0|I())>>31|((0|d)<0?-1:0)<<1),t=0|nn(0|r,0|h,p&f|0,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l),e=0|I(),s=s-1|0}while(0|s);c=u,u=0}else c=a,u=0,a=0;return s=0,0|A&&(i[A>>2]=t,i[A+4>>2]=e),d=o<<1&-2|a,0|(C(0|(p=(0|o)>>>31|(c|s)<<1|u)),d)}function on(t,e,n,r){n|=0;var i,A,o,s,a;return A=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|nn((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0)|0,(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|a,0|s),t=A^a,e=i^s,0|nn((0|An(o,0|I(),0|nn(A^n|0,i^r|0,0|A,0|i),0|I(),0))^t,(0|I())^e,0|t,0|e)}function sn(t,e,n,r){e|=0,r|=0;var i,A;return n=0|function(t,e){var n,r,i,A=0;return t=((n=0|v(A=65535&(e|=0),i=65535&(t|=0)))>>>16)+(0|v(A,r=t>>>16))|0,e=0|v(A=e>>>16,i),0|(C((t>>>16)+(0|v(A,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(i=t|=0,A=n|=0),t=0|I(),0|(C((0|v(e,A))+(0|v(r,i))+t|0&t),n)}function an(t,e,n,r){n|=0;var A,o,s,a,u,c;return A=M,M=M+16|0,a=0|A,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,An(t=0|nn((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0)|0,(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|s,0|o),e=0|I(),0|nn(c^n|0,u^r|0,0|c,0|u),0|I(),a),r=0|nn(i[a>>2]^s|0,i[a+4>>2]^o|0,0|s,0|o),n=0|I(),M=A,0|(C(0|n),r)}function un(t,e,n,r){var A,o;return o=M,M=M+16|0,An(t|=0,e|=0,n|=0,r|=0,A=0|o),M=o,0|(C(0|i[A+4>>2]),i[A>>2])}function cn(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(C(e>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(C(0|((0|e)<0?-1:0)),e>>n-32)}function ln(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(C(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(C(0),e>>>n-32|0)}function fn(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(C(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(C(t<<n-32),0)}function hn(t,e,n){return t|=0,32==(0|(e=0|E(e|=0)))&&(e=e+(0|E(t))|0),C(0),0|e}function pn(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+w(+t,+e)}function dn(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function gn(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function yn(t,e,n){t|=0,e|=0;var A,o,s=0;if((0|(n|=0))>=8192)return D(0|t,0|e,0|n),0|t;if(o=0|t,A=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&A)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=A-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|A);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function _n(t,e,n){e|=0;var A,o=0,s=0,a=0;if(A=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(a=e|e<<8|e<<16|e<<24,s=(o=-4&A)-64|0;(0|t)<=(0|s);)i[t>>2]=a,i[t+4>>2]=a,i[t+8>>2]=a,i[t+12>>2]=a,i[t+16>>2]=a,i[t+20>>2]=a,i[t+24>>2]=a,i[t+28>>2]=a,i[t+32>>2]=a,i[t+36>>2]=a,i[t+40>>2]=a,i[t+44>>2]=a,i[t+48>>2]=a,i[t+52>>2]=a,i[t+56>>2]=a,i[t+60>>2]=a,t=t+64|0;for(;(0|t)<(0|o);)i[t>>2]=a,t=t+4|0}for(;(0|t)<(0|A);)r[t|0]=e,t=t+1|0;return A-n|0}function mn(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function vn(t){t|=0;var e,n,r;return r=0|N(),(0|t)>0&(0|(e=(n=0|i[s>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),S(12),-1):(0|e)>(0|r)&&!(0|L(0|e))?(S(12),-1):(i[s>>2]=e,0|n)}return{___divdi3:on,___muldi3:sn,___remdi3:an,___uremdi3:un,_areNeighborCells:function(t,e,n,r,A){A|=0;var o,s,a,u=0,c=0,l=0,f=0;if(a=M,M=M+64|0,s=a,o=a+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return M=a,0|(A=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return i[A>>2]=0,M=a,0|(A=0);if(c=0|ln(0|t,0|e,52),I(),c&=15,f=0|ln(0|n,0|r,52),I(),(0|c)!=(15&f))return M=a,0|(A=12);if(u=c+-1|0,c>>>0>1){Vt(t,e,u,s),Vt(n,r,u,o),l=0|i[(f=s)>>2],f=0|i[f+4>>2];t:do{if((0|l)==(0|i[o>>2])&&(0|f)==(0|i[o+4>>2])){u=0|ln(0|t,0|e,0|(c=3*(15^c)|0)),I(),u&=7,c=0|ln(0|n,0|r,0|c),I(),c&=7;do{if(!(0|u)|!(0|c))i[A>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|jt(l,f)){u=5;break}if((0|i[15536+(u<<2)>>2])!=(0|c)&&(0|i[15568+(u<<2)>>2])!=(0|c))break t;i[A>>2]=1,u=0}}while(0);return M=a,0|(A=u)}}while(0)}c=(u=s)+56|0;do{i[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return O(t,e,1,s),u=(0|i[(e=s)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+8|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+16|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+24|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+32|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+40|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)?1:1&((0|i[(u=s+48|0)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0),i[A>>2]=u,M=a,0|(A=0)},_bitshift64Ashr:cn,_bitshift64Lshr:ln,_bitshift64Shl:fn,_calloc:tn,_cellAreaKm2:function(t,e,n){return 0|(t=0|ye(t|=0,e|=0,n|=0))||(A[n>>3]=6371.007180918475*+A[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|ye(t|=0,e|=0,n|=0))||(A[n>>3]=6371.007180918475*+A[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:ye,_cellToBoundary:Ae,_cellToCenterChild:Xt,_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0;if(A=M,M=M+16|0,_=A,m=0|ln(0|(t|=0),0|(e|=0),52),I(),m&=15,n>>>0>15)return M=A,0|(m=4);if((0|m)<(0|n))return M=A,0|(m=12);if((0|m)!=(0|n))if(s=0|fn(0|n,0,52),s|=t,u=I()|-15728641&e,(0|m)>(0|n)){c=n;do{y=0|fn(7,0,3*(14-c|0)|0),c=c+1|0,s|=y,u=0|I()|u}while((0|c)<(0|m));y=s}else y=s;else y=t,u=e;g=0|ln(0|y,0|u,45),I();t:do{if(0|z(127&g)){if(c=0|ln(0|y,0|u,52),I(),0|(c&=15))for(s=1;;){if(!(!((g=0|fn(7,0,3*(15-s|0)|0))&y|0)&!((0|I())&u))){l=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(i[(g=r)>>2]=0,i[g+4>>2]=0,(0|m)>(0|n)){for(g=-15728641&e,d=m;;){if(p=d,(d=d+-1|0)>>>0>15|(0|m)<(0|d)){l=19;break}if((0|m)!=(0|d))if(s=0|fn(0|d,0,52),s|=t,c=0|I()|g,(0|m)<(0|p))h=s;else{l=d;do{h=0|fn(7,0,3*(14-l|0)|0),l=l+1|0,s|=h,c=0|I()|c}while((0|l)<(0|m));h=s}else h=t,c=e;if(f=0|ln(0|h,0|c,45),I(),0|z(127&f)){f=0|ln(0|h,0|c,52),I(),f&=15;e:do{if(f)for(l=1;;){if(s=0|ln(0|h,0|c,3*(15-l|0)|0),I(),0|(s&=7))break e;if(!(l>>>0<f>>>0)){s=0;break}l=l+1|0}else s=0}while(0);s=1&!(0|s)}else s=0;if(c=0|ln(0|t,0|e,3*(15-p|0)|0),I(),7==(0|(c&=7))){o=5,l=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,l=42;break}if(0|(h=c+((!!(0|c)&s)<<31>>31)|0)&&(l=0|Ie(7,0,l=m-p|0,((0|l)<0)<<31>>31),f=0|I(),s?(s=0|en(0|(s=0|sn(0|l,0|f,5,0)),0|I(),-5,-1),s=0|en(0|(s=0|on(0|s,0|I(),6,0)),0|I(),1,0),c=0|I()):(s=l,c=f),p=0|en(0|s,0|c,0|(p=0|sn(0|l,0|f,0|(p=h+-1|0),((0|p)<0)<<31>>31)),0|I()),f=0|en(0|p,0|(h=0|I()),0|i[(f=r)>>2],0|i[f+4>>2]),h=0|I(),i[(p=r)>>2]=f,i[p+4>>2]=h),(0|d)<=(0|n)){l=37;break}}if(19==(0|l))x(27795,27122,1367,27158);else{if(37==(0|l)){o=0|i[(a=r)+4>>2],a=0|i[a>>2];break}if(42==(0|l))return M=A,0|o}}else o=0,a=0}else l=33}while(0);t:do{if(33==(0|l)){if(i[(g=r)>>2]=0,i[g+4>>2]=0,(0|m)>(0|n)){for(s=m;;){if(o=0|ln(0|t,0|e,3*(15-s|0)|0),I(),7==(0|(o&=7))){o=5;break}if(o=0|sn(0|(a=0|Ie(7,0,a=m-s|0,((0|a)<0)<<31>>31)),0|I(),0|o,0),a=0|I(),a=0|en(0|i[(g=r)>>2],0|i[g+4>>2],0|o,0|a),o=0|I(),i[(g=r)>>2]=a,i[g+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return M=A,0|o}o=0,a=0}}while(0);return 0|Yt(y,u,m,_)&&x(27795,27122,1327,27173),((0|o)>-1|-1==(0|o)&a>>>0>4294967295)&((0|(_=0|i[(m=_)+4>>2]))>(0|o)|((0|_)==(0|o)?(0|i[m>>2])>>>0>a>>>0:0))?(M=A,0|(m=0)):(x(27795,27122,1407,27158),0)},_cellToChildren:function(t,e,n,r){r|=0;var A,o,s=0,a=0;if(o=M,M=M+16|0,se(A=o,t|=0,e|=0,n|=0),!(0|(t=0|i[(e=A)>>2]))&!(0|(e=0|i[e+4>>2])))return M=o,0;s=0,n=0;do{i[(a=r+(s<<3)|0)>>2]=t,i[a+4>>2]=e,s=0|en(0|s,0|n,1,0),n=0|I(),ue(A),t=0|i[(a=A)>>2],e=0|i[a+4>>2]}while(!(!(0|t)&!(0|e)));return M=o,0},_cellToChildrenSize:Yt,_cellToLatLng:ie,_cellToLocalIj:function(t,e,n,r,i,A){var o,s;return t|=0,e|=0,n|=0,r|=0,A|=0,s=M,M=M+16|0,o=s,(i|=0)?t=15:(t=0|Ee(t,e,n,r,o))||(xt(o,A),t=0),M=s,0|t},_cellToParent:Vt,_cellToVertex:ze,_cellToVertexes:function(t,e,n){n|=0;var r,A=0,o=0;return o=!(0|jt(t|=0,e|=0)),r=!(0|(A=0|ze(t,e,0,n))),o?r?0|(A=0|ze(t,e,1,n+8|0))||0|(A=0|ze(t,e,2,n+16|0))||0|(A=0|ze(t,e,3,n+24|0))||(A=0|ze(t,e,4,n+32|0))?0|(o=A):0|ze(t,e,5,n+40|0):0|(o=A):r?0|(A=0|ze(t,e,1,n+8|0))||0|(A=0|ze(t,e,2,n+16|0))||0|(A=0|ze(t,e,3,n+24|0))||0|(A=0|ze(t,e,4,n+32|0))?0|(o=A):(i[(o=n+40|0)>>2]=0,i[o+4>>2]=0,0|(o=0)):0|(o=A)},_cellsToDirectedEdge:function(t,e,n,r,A){return A|=0,7==(0|(n=0|U(t|=0,e|=0,n|=0,r|=0)))?0|(A=11):(r=0|fn(0|n,0,56),e=-2130706433&e|I()|268435456,i[A>>2]=t|r,i[A+4>>2]=e,0|(A=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,A,o,s=0;if(o=M,M=M+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,A,o=0,s=0,a=0,u=0,c=0,l=0;if(A=M,M=M+176|0,r=A,(0|(e|=0))<1)return Ve(n,0,0),M=A,0;for(c=0|ln(0|i[(c=t)>>2],0|i[c+4>>2],52),I(),Ve(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Ae(0|i[(o=t+(c<<3)|0)>>2],0|i[o+4>>2],r)));){if((0|(o=0|i[r>>2]))>0){u=0;do{a=r+8+(u<<4)|0,(s=0|We(n,o=r+8+((0|(u=u+1|0))%(0|o)<<4)|0,a))?He(n,s):Xe(n,a,o),o=0|i[r>>2]}while((0|u)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,l=13;break}}return 13==(0|l)?(M=A,0|o):(Ye(n),M=A,0|(l=o))}(t|=0,e|=0,A=o+16|0),0|t)return M=o,0|(n=t);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(t=0|je(A)))do{e=0|_e(n);do{me(e,t),s=t+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],He(A,t),t=0|$e(A,r)}while(0|t);t=0|je(A)}while(0|t);return Ye(A),(t=0|be(n))?(ve(n),M=o,0|(s=t)):(M=o,0|(s=0))},_childPosToCell:function(t,e,n,r,A,o){t|=0,e|=0,o|=0;var s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,a=s,(A|=0)>>>0>15)return M=s,0|(o=4);if(u=0|ln(0|(n|=0),0|(r|=0),52),I(),(0|(u&=15))>(0|A))return M=s,0|(o=12);if(0|Yt(n,r,A,a)&&x(27795,27122,1327,27173),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(l=0|i[(f=a)+4>>2]))>(0|e)|((0|l)==(0|e)?(0|i[f>>2])>>>0>t>>>0:0))))return M=s,0|(o=2);f=A-u|0,A=0|fn(0|A,0,52),c=I()|-15728641&r,i[(l=o)>>2]=A|n,i[l+4>>2]=c,l=0|ln(0|n,0|r,45),I();t:do{if(0|z(127&l)){if(0|u)for(a=1;;){if(!(!((l=0|fn(7,0,3*(15-a|0)|0))&n|0)&!((0|I())&r)))break t;if(!(a>>>0<u>>>0))break;a=a+1|0}if((0|f)<1)return M=s,0|(o=0);for(l=15^u,r=-1,c=1,a=1;;){u=0|Ie(7,0,u=f-c|0,((0|u)<0)<<31>>31),n=0|I();do{if(a){if(a=0|on(0|(a=0|en(0|(a=0|sn(0|u,0|n,5,0)),0|I(),-5,-1)),0|I(),6,0),(0|e)>(0|(A=0|I()))|(0|e)==(0|A)&t>>>0>a>>>0){e=0|nn(0|(e=0|en(0|t,0|e,-1,-1)),0|I(),0|a,0|A),a=0|I(),d=0|i[(h=o)>>2],h=0|i[h+4>>2],p=0|fn(7,0,0|(g=3*(l+r|0)|0)),h&=~I(),g=0|fn(0|(A=0|en(0|(r=0|on(0|e,0|a,0|u,0|n)),0|(t=0|I()),2,0)),0|I(),0|g),h=0|I()|h,i[(A=o)>>2]=g|d&~p,i[A+4>>2]=h,t=0|nn(0|e,0|a,0|(t=0|sn(0|r,0|t,0|u,0|n)),0|I()),a=0,e=0|I();break}p=0|i[(g=o)>>2],g=0|i[g+4>>2],d=0|fn(7,0,3*(l+r|0)|0),g&=~I(),i[(a=o)>>2]=p&~d,i[a+4>>2]=g,a=1;break}A=0|i[(p=o)>>2],p=0|i[p+4>>2],h=0|fn(7,0,0|(r=3*(l+r|0)|0)),p&=~I(),r=0|fn(0|(g=0|on(0|t,0|e,0|u,0|n)),0|(a=0|I()),0|r),p=0|I()|p,i[(d=o)>>2]=r|A&~h,i[d+4>>2]=p,t=0|nn(0|t,0|e,0|(a=0|sn(0|g,0|a,0|u,0|n)),0|I()),a=0,e=0|I()}while(0);if(!((0|f)>(0|c))){e=0;break}r=~c,c=c+1|0}return M=s,0|e}}while(0);if((0|f)<1)return M=s,0|(g=0);for(A=15^u,a=1;;){if(d=0|Ie(7,0,d=f-a|0,((0|d)<0)<<31>>31),g=0|I(),n=0|i[(c=o)>>2],c=0|i[c+4>>2],r=0|fn(7,0,0|(u=3*(A-a|0)|0)),c&=~I(),u=0|fn(0|(h=0|on(0|t,0|e,0|d,0|g)),0|(p=0|I()),0|u),c=0|I()|c,i[(l=o)>>2]=u|n&~r,i[l+4>>2]=c,t=0|nn(0|t,0|e,0|(g=0|sn(0|h,0|p,0|d,0|g)),0|I()),e=0|I(),(0|f)<=(0|a)){e=0;break}a=a+1|0}return M=s,0|e},_compactCells:function(t,e,n,r){e|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,S=0,N=0,D=0,L=0,T=0,M=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(M=0);if(s=0|i[(o=t|=0)>>2],!0&!(15728640&(o=0|i[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(M=0);if(i[(M=e)>>2]=s,i[M+4>>2]=o,1==(0|n)&!(0|r))return 0|(M=0);o=1,s=0;do{T=0|i[(L=t+(o<<3)|0)+4>>2],i[(M=e+(o<<3)|0)>>2]=i[L>>2],i[M+4>>2]=T,o=0|en(0|o,0|s,1,0),s=0|I()}while((0|s)<(0|r)|(0|s)==(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(T=0|Je(A=n<<3)))return 0|(M=13);if(yn(0|T,0|t,0|A),!(L=0|tn(n,8)))return Ze(T),0|(M=13);t:for(;;){N=0|ln(0|(l=0|i[(o=T)>>2]),0|(o=0|i[o+4>>2]),52),I(),D=(N&=15)+-1|0,S=!!(0|N),C=(0|r)>0|!(0|r)&n>>>0>0;e:do{if(S&C){if(v=0|fn(0|D,0,52),b=0|I(),D>>>0>15){if(!(!(0|l)&!(0|o))){M=16;break t}for(s=0,t=0;;){if(s=0|en(0|s,0|t,1,0),!((0|(t=0|I()))<(0|r)|(0|t)==(0|r)&s>>>0<n>>>0))break e;if(!(!(0|(E=0|i[(a=T+(s<<3)|0)>>2]))&!(0|(a=0|i[a+4>>2])))){o=a,M=16;break t}}}for(u=l,t=o,s=0,a=0;;){if(!(!(0|u)&!(0|t))){if(!(!0&!(117440512&t))){M=21;break t}if(f=0|ln(0|u,0|t,52),I(),(0|(f&=15))<(0|D)){o=12,M=27;break t}if((0|f)!=(0|D)&&(u|=v,t=-15728641&t|b,f>>>0>=N>>>0)){c=D;do{E=0|fn(7,0,3*(14-c|0)|0),c=c+1|0,u|=E,t=0|I()|t}while(c>>>0<f>>>0)}if(p=0|un(0|u,0|t,0|n,0|r),d=0|I(),!(!(0|(h=0|i[(f=c=L+(p<<3)|0)>>2]))&!(0|(f=0|i[f+4>>2])))){_=0,m=0;do{if((0|_)>(0|r)|(0|_)==(0|r)&m>>>0>n>>>0){M=31;break t}if((0|h)==(0|u)&(-117440513&f)==(0|t)){g=0|ln(0|h,0|f,56),I(),y=(g&=7)+1|0,E=0|ln(0|h,0|f,45),I();n:do{if(0|z(127&E)){if(h=0|ln(0|h,0|f,52),I(),!(h&=15)){f=6;break}for(f=1;;){if(!(!((E=0|fn(7,0,3*(15-f|0)|0))&u|0)&!((0|I())&t))){f=7;break n}if(!(f>>>0<h>>>0)){f=6;break}f=f+1|0}}else f=7}while(0);if((g+2|0)>>>0>f>>>0){M=41;break t}E=0|fn(0|y,0,56),t=I()|-117440513&t,i[(w=c)>>2]=0,i[w+4>>2]=0,u|=E}else p=0|an(0|(p=0|en(0|p,0|d,1,0)),0|I(),0|n,0|r),d=0|I();m=0|en(0|m,0|_,1,0),_=0|I(),h=0|i[(f=c=L+(p<<3)|0)>>2],f=0|i[f+4>>2]}while(!(!(0|h)&!(0|f)))}i[(E=c)>>2]=u,i[E+4>>2]=t}if(s=0|en(0|s,0|a,1,0),!((0|(a=0|I()))<(0|r)|(0|a)==(0|r)&s>>>0<n>>>0))break e;u=0|i[(t=T+(s<<3)|0)>>2],t=0|i[t+4>>2]}}}while(0);if(E=0|en(0|n,0|r,5,0),(w=0|I())>>>0<0|!(0|w)&E>>>0<11){M=85;break}if(E=0|on(0|n,0|r,6,0),I(),!(E=0|tn(E,8))){M=48;break}do{if(C){for(y=0,t=0,g=0,_=0;;){if(!(0|(s=0|i[(a=f=L+(y<<3)|0)>>2]))&!(0|(a=0|i[a+4>>2])))w=g;else{h=0|ln(0|s,0|a,56),I(),u=(h&=7)+1|0,p=-117440513&a,w=0|ln(0|s,0|a,45),I();e:do{if(0|z(127&w)){if(d=0|ln(0|s,0|a,52),I(),0|(d&=15))for(c=1;;){if(!(!(s&(w=0|fn(7,0,3*(15-c|0)|0))|0)&!(p&(0|I()))))break e;if(!(c>>>0<d>>>0))break;c=c+1|0}s|=a=0|fn(0|u,0,56),a=0|I()|p,i[(u=f)>>2]=s,i[u+4>>2]=a,u=h+2|0}}while(0);7==(0|u)?(i[(w=E+(t<<3)|0)>>2]=s,i[w+4>>2]=-117440513&a,t=0|en(0|t,0|g,1,0),w=0|I()):w=g}if(y=0|en(0|y,0|_,1,0),!((0|(_=0|I()))<(0|r)|(0|_)==(0|r)&y>>>0<n>>>0))break;g=w}if(C){if(m=D>>>0>15,v=0|fn(0|D,0,52),b=0|I(),!S){for(s=0,c=0,u=0,a=0;!(0|l)&!(0|o)||(i[(D=e+(s<<3)|0)>>2]=l,i[D+4>>2]=o,s=0|en(0|s,0|c,1,0),c=0|I()),u=0|en(0|u,0|a,1,0),(0|(a=0|I()))<(0|r)|(0|a)==(0|r)&u>>>0<n>>>0;)l=0|i[(o=T+(u<<3)|0)>>2],o=0|i[o+4>>2];o=w;break}for(s=0,c=0,a=0,u=0;;){do{if(!(!(0|l)&!(0|o))){if(d=0|ln(0|l,0|o,52),I(),m|(0|(d&=15))<(0|D)){M=80;break t}if((0|d)!=(0|D)){if(f=l|v,h=-15728641&o|b,d>>>0>=N>>>0){p=D;do{S=0|fn(7,0,3*(14-p|0)|0),p=p+1|0,f|=S,h=0|I()|h}while(p>>>0<d>>>0)}}else f=l,h=o;g=0|un(0|f,0|h,0|n,0|r),p=0,d=0,_=0|I();do{if((0|p)>(0|r)|(0|p)==(0|r)&d>>>0>n>>>0){M=81;break t}if((-117440513&(y=0|i[(S=L+(g<<3)|0)+4>>2]))==(0|h)&&(0|i[S>>2])==(0|f)){M=65;break}g=0|an(0|(S=0|en(0|g,0|_,1,0)),0|I(),0|n,0|r),_=0|I(),d=0|en(0|d,0|p,1,0),p=0|I(),S=L+(g<<3)|0}while((0|i[S>>2])!=(0|f)||(0|i[S+4>>2])!=(0|h));if(65==(0|M)&&(M=0,!0&100663296==(117440512&y)))break;i[(S=e+(s<<3)|0)>>2]=l,i[S+4>>2]=o,s=0|en(0|s,0|c,1,0),c=0|I()}}while(0);if(a=0|en(0|a,0|u,1,0),!((0|(u=0|I()))<(0|r)|(0|u)==(0|r)&a>>>0<n>>>0))break;l=0|i[(o=T+(a<<3)|0)>>2],o=0|i[o+4>>2]}o=w}else s=0,o=w}else s=0,t=0,o=0}while(0);if(_n(0|L,0,0|A),yn(0|T,0|E,t<<3),Ze(E),!(0|t)&!(0|o)){M=89;break}e=e+(s<<3)|0,r=o,n=t}if(16==(0|M))!0&!(117440512&o)?(o=4,M=27):M=21;else if(31==(0|M))x(27795,27122,620,27132);else{if(41==(0|M))return Ze(T),Ze(L),0|(M=10);if(48==(0|M))return Ze(T),Ze(L),0|(M=13);80==(0|M)?x(27795,27122,711,27132):81==(0|M)?x(27795,27122,723,27132):85==(0|M)&&(yn(0|e,0|T,n<<3),M=89)}return 21==(0|M)?(Ze(T),Ze(L),0|(M=5)):27==(0|M)?(Ze(T),Ze(L),0|(M=o)):89==(0|M)?(Ze(T),Ze(L),0|(M=0)):0},_constructCell:function(t,e,n,A){n|=0,A|=0;var o=0,s=0,a=0,u=0,c=0,l=0;if((t|=0)>>>0>15)return 0|(A=4);if((e|=0)>>>0>121)return 0|(A=17);a=0|fn(0|t,0,52),o=0|I(),u=0|fn(0|e,0,45),o=0|o|I()|134225919;t:do{if((0|t)>=1){for(u=1,a=!!(0|r[20528+e|0]),s=-1;;){if((e=0|i[n+(u+-1<<2)>>2])>>>0>6){o=18,e=10;break}if(!(!(0|e)|1^a)){if(1==(0|e)){o=19,e=10;break}a=0}if(c=0|fn(7,0,0|(l=3*(15-u|0)|0)),o&=~I(),s=(e=0|fn(0|e,((0|e)<0)<<31>>31,0|l))|s&~c,o=0|I()|o,!((0|u)<(0|t)))break t;u=u+1|0}if(10==(0|e))return 0|o}else s=-1}while(0);return i[(l=A)>>2]=s,i[l+4>>2]=o,0|(l=0)},_destroyLinkedMultiPolygon:ve,_directedEdgeToBoundary:Tt,_directedEdgeToCells:function(t,e,n){t|=0;var r,A,o,s=0;return r=M,M=M+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(A=-2130706433&e|134217728,i[(o=n|=0)>>2]=t,i[o+4>>2]=A,i[s>>2]=0,e=0|ln(0|t,0|e,56),I(),s=0|B(t,A,7&e,s,n+8|0),M=r,0|s):(M=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|Tt(t|=0,e|=0,u=r)))return u=t,a=+A[n>>3],a*=6371.007180918475,A[n>>3]=a,M=r,0|u;if(A[n>>3]=0,(0|(t=0|i[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,A[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+A[u+8>>3],s=+A[u+16>>3],a=0;do{p=o,o=+A[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+A[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return A[n>>3]=a,u=0,d=a,d*=6371.007180918475,A[n>>3]=d,M=r,0|u},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|Tt(t|=0,e|=0,u=r)))return u=t,a=+A[n>>3],a*=6371.007180918475,a*=1e3,A[n>>3]=a,M=r,0|u;if(A[n>>3]=0,(0|(t=0|i[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,a*=1e3,A[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+A[u+8>>3],s=+A[u+16>>3],a=0;do{p=o,o=+A[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+A[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return A[n>>3]=a,u=0,d=a,d*=6371.007180918475,d*=1e3,A[n>>3]=d,M=r,0|u},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|Tt(t|=0,e|=0,u=r)))return M=r,0|(u=t);if(A[n>>3]=0,(0|(t=0|i[u>>2]))<=1)return M=r,0|(u=0);e=t+-1|0,t=0,o=+A[u+8>>3],s=+A[u+16>>3],a=0;do{p=o,o=+A[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+A[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+o)*+f(+p)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)<(0|e));return A[n>>3]=a,M=r,0|(u=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),i=new Int32Array(t),A=new Float64Array(t),n=t,!0},_free:Ze,_getBaseCellNumber:Qt,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,A,o=0;return r=M,M=M+16|0,i[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(A=0|ln(0|t,0|e,56),I(),o=0|B(t,-2130706433&e|134217728,7&A,o,n),M=r,0|o):(M=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(i[n>>2]=t,i[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:pe,_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[20912+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[21040+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;A=M,M=M+128|0,f=A+112|0,a=A+96|0,h=A,s=0|ln(0|(e|=0),0|(n|=0),52),I(),c=15&s,i[f>>2]=c,u=0|ln(0|e,0|n,45),I(),u&=127;t:do{if(0|z(u)){if(0|c)for(o=1;;){if(!(!((l=0|fn(7,0,3*(15-o|0)|0))&e|0)&!((0|I())&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return l=0|fn(c+1|0,0,52),h=I()|-15728641&n,h=0|t((l|e)&~(f=0|fn(7,0,3*(14-c|0)|0)),h&~I(),r),M=A,0|h;s=1}else s=0}while(0);if(!(o=0|re(e,n,a))){s?(kt(a,f,h),l=5):(Ut(a,f,h),l=6);t:do{if(0|z(u))if(c)for(o=1;;){if(!(!((u=0|fn(7,0,3*(15-o|0)|0))&e|0)&!((0|I())&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);_n(0|r,-1,e<<2);t:do{if(s)for(a=0;;){if(Ft(u=h+(a<<4)|0,0|i[f>>2]),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}else for(a=0;;){if(Bt(u=h+(a<<4)|0,0|i[f>>2],0,1),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}}while(0)}return M=A,0|(h=o)},_getIndexDigit:function(t,e,n,r){return r|=0,((n|=0)+-1|0)>>>0>14?0|(r=4):(n=0|ln(0|(t|=0),0|(e|=0),3*(15-n|0)|0),I(),i[r>>2]=7&n,0|(r=0))},_getNumCells:de,_getPentagons:oe,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{fn(0|e,0,45),r=134225919|I(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|ln(0|(t|=0),0|(e|=0),52),I(),15&e},_greatCircleDistanceKm:he,_greatCircleDistanceM:function(t,e){t|=0;var n,r,i,o=0;return r=+A[(e|=0)>>3],n=+A[t>>3],o=(i=+h(.5*(r-n)))*i+(o=+h(.5*(+A[e+8>>3]-+A[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,i,o=0;return r=+A[(e|=0)>>3],n=+A[t>>3],o=(i=+h(.5*(r-n)))*i+(o=+h(.5*(+A[e+8>>3]-+A[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:P,_gridDistance:function(t,e,n,r,A){n|=0,r|=0,A|=0;var o,s,a=0,u=0;return s=M,M=M+32|0,u=s,0|(o=0|Ee(t|=0,e|=0,t,e,a=s+12|0))?(M=s,0|(u=o)):0|(t=0|Ee(t,e,n,r,u))?(M=s,0|(u=t)):(a=0|It(a,u),i[(u=A)>>2]=a,i[u+4>>2]=((0|a)<0)<<31>>31,M=s,0|(u=0))},_gridPathCells:function(t,e,n,r,A){n|=0,r|=0,A|=0;var o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,S=0,N=0;if(s=M,M=M+48|0,c=s+12|0,S=s,!(a=0|Ee(t|=0,e|=0,t,e,o=s+24|0))&&!(a=0|Ee(t,e,n,r,c))){C=((0|(E=0|It(o,c)))<0)<<31>>31,i[o>>2]=0,i[o+4>>2]=0,i[o+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|Ee(t,e,t,e,o)&&x(27795,27538,692,27747),0|Ee(t,e,n,r,c)&&x(27795,27538,697,27747),Nt(o),Nt(c),p=0|E?1/+(0|E):0,n=0|i[o>>2],m=p*+((0|i[c>>2])-n|0),r=0|i[(v=o+4|0)>>2],b=p*+((0|i[c+4>>2])-r|0),a=0|i[(w=o+8|0)>>2],p*=+((0|i[c+8>>2])-a|0),i[S>>2]=n,i[(d=S+4|0)>>2]=r,i[(g=S+8|0)>>2]=a;t:do{if((0|E)<0)a=0;else for(y=0,_=0;;){N=m*(f=+(_>>>0)+4294967296*+(0|y))+ +(0|n),l=b*f+ +(0|r),f=p*f+ +(0|a),n=~~+gn(+N),c=~~+gn(+l),a=~~+gn(+f),N=+u(+(+(0|n)-N)),l=+u(+(+(0|c)-l)),f=+u(+(+(0|a)-f));do{if(!(N>l&N>f)){if(h=0-n|0,l>f){r=h-a|0;break}r=c,a=h-c|0;break}n=0-(c+a)|0,r=c}while(0);if(i[S>>2]=n,i[d>>2]=r,i[g>>2]=a,Dt(S),0|(a=0|Ce(t,e,S,A+(_<<3)|0)))break t;if(!((0|y)<(0|C)|(0|y)==(0|C)&_>>>0<E>>>0)){a=0;break t}n=0|en(0|_,0|y,1,0),y=r=0|I(),_=n,n=0|i[o>>2],r=0|i[v>>2],a=0|i[w>>2]}}while(0);return M=s,0|(S=a)}return M=s,0|(S=a)},_gridPathCellsSize:function(t,e,n,r,A){n|=0,r|=0,A|=0;var o,s=0,a=0,u=0;return o=M,M=M+32|0,u=o,(s=0|Ee(t|=0,e|=0,t,e,a=o+12|0))||(s=0|Ee(t,e,n,r,u))?(M=o,0|(u=s)):(r=0|en(0|(r=0|It(a,u)),((0|r)<0)<<31>>31,1,0),a=0|I(),i[(u=A)>>2]=r,i[u+4>>2]=a,M=o,0|(u=0))},_gridRing:function(t,e,n,r){return 0|F(t|=0,e|=0,n|=0,r|=0)?(_n(0|r,0,48*n|0),0|(r=0|G(t,e,n,r))):0|(r=0)},_gridRingUnsafe:F,_i64Add:en,_i64Subtract:nn,_isPentagon:jt,_isResClassIII:function(t,e){return e=0|ln(0|(t|=0),0|(e|=0),52),I(),1&e},_isValidCell:zt,_isValidDirectedEdge:Lt,_isValidIndex:function(t,e){t|=0;var n=0,i=0,A=0,o=0;if(!0&134217728==(-16777216&(e|=0))&&(i=0|ln(0|t,0|e,52),I(),i&=15,n=0|ln(0|t,0|e,45),I(),(n&=127)>>>0<=121)&&!(613566756&(o=0|fn(0|(A=0|ln(0|t,0|e,0|(o=3*(15^i)|0))),0|I(),0|o))&(0|nn(-1227133514,-1171,0|o,0|(A=0|I()))))&!(4681&A&I())&&15==(0|i)|!(0|(o=0|ln(0|(0|fn(0|~t,0|~e,0|(o=19+(3*i|0)|0))),0|I(),0|o)))&!(0|I())){if(!(0|r[20528+n|0]))return 0|(o=1);if(!(0|t)&!(0|(n=8191&e)))return 0|(o=1);if(o=0|hn(0|t,0|n),I(),(63-o|0)%3|0)return 0|(o=1)}return 0|Lt(t,e)?0|(o=1):0|(o=1&!!(0|qe(t,e)))},_isValidVertex:qe,_latLngToCell:ee,_llvm_ctlz_i64:hn,_llvm_maxnum_f64:pn,_llvm_minnum_f64:dn,_llvm_round_f64:gn,_localIjToCell:function(t,e,n,r,i){var A,o;return t|=0,e|=0,n|=0,i|=0,o=M,M=M+16|0,A=o,(r|=0)?n=15:(n=0|St(n,A))||(n=0|Ce(t,e,A,i)),M=o,0|n},_malloc:Je,_maxFaceCount:function(t,e,n){n|=0;var r=0,A=0;if(A=0|ln(0|(t|=0),0|(e|=0),45),I(),!(0|z(127&A)))return A=2,i[n>>2]=A,0;if(A=0|ln(0|t,0|e,52),I(),!(A&=15))return A=5,i[n>>2]=A,0;for(r=1;;){if(!(!((0|fn(7,0,3*(15-r|0)|0))&t|0)&!((0|I())&e))){r=2,t=6;break}if(!(r>>>0<A>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,A=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|de(15,e)):(A=0|sn(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|I(),n=0|en(0|t,0|n,1,0),n=0|en(0|(n=0|sn(0|A,0|r,0|n,0|I())),0|I(),1,0),t=0|I(),i[e>>2]=n,i[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){t|=0,e|=0,r|=0;var A,o=0,s=0,a=0,u=0,c=0;if(A=M,M=M+48|0,o=A+16|0,s=A+8|0,a=A,0|(n=0|Me(n|=0)))return M=A,0|(a=n);if(u=0|i[(c=t)+4>>2],i[(n=s)>>2]=i[c>>2],i[n+4>>2]=u,Te(s,o),!(n=0|nt(o,e,a))){if(e=0|i[s>>2],(0|(s=0|i[t+8>>2]))>0){o=0|i[t+12>>2],n=0;do{e=(0|i[o+(n<<3)>>2])+e|0,n=n+1|0}while((0|n)<(0|s))}o=0|i[(n=a)>>2],(0|(n=0|i[n+4>>2]))<(0|(s=((0|e)<0)<<31>>31))|(0|n)==(0|s)&o>>>0<e>>>0?(i[(n=a)>>2]=e,i[n+4>>2]=s,n=s):e=o,u=0|en(0|e,0|n,12,0),c=0|I(),i[(n=a)>>2]=u,i[n+4>>2]=c,i[(n=r)>>2]=u,i[n+4>>2]=c,n=0}return M=A,0|(c=n)},_maxPolygonToCellsSizeExperimental:function(t,e,n,o){e|=0,n|=0,o|=0;var s,a,c=0,l=0,h=0,p=0,d=0,g=0,y=0,_=0;if(a=M,M=M+48|0,d=a+32|0,p=a+40|0,s=a,!(0|i[(t|=0)>>2]))return i[(g=o)>>2]=0,i[g+4>>2]=0,M=a,0|(g=0);qt(d,0,0,0),c=0|i[(h=d)>>2],h=0|i[h+4>>2];do{if(e>>>0>15)i[(g=s)>>2]=0,i[g+4>>2]=0,i[s+8>>2]=4,i[s+12>>2]=-1,n=s+29|0,i[(g=s+16|0)>>2]=0,i[g+4>>2]=0,i[g+8>>2]=0,r[g+12|0]=0,r[n|0]=0|r[p|0],r[n+1|0]=0|r[p+1|0],r[n+2|0]=0|r[p+2|0],n=4,g=9;else{if(0|(n=0|Me(n))){i[(d=s)>>2]=0,i[d+4>>2]=0,i[s+8>>2]=n,i[s+12>>2]=-1,g=s+29|0,i[(d=s+16|0)>>2]=0,i[d+4>>2]=0,i[d+8>>2]=0,r[d+12|0]=0,r[g|0]=0|r[p|0],r[g+1|0]=0|r[p+1|0],r[g+2|0]=0|r[p+2|0],g=9;break}if(!(n=0|tn(1+(0|i[t+8>>2])|0,32))){i[(g=s)>>2]=0,i[g+4>>2]=0,i[s+8>>2]=13,i[s+12>>2]=-1,n=s+29|0,i[(g=s+16|0)>>2]=0,i[g+4>>2]=0,i[g+8>>2]=0,r[g+12|0]=0,r[n|0]=0|r[p|0],r[n+1|0]=0|r[p+1|0],r[n+2|0]=0|r[p+2|0],n=13,g=9;break}Oe(t,n),i[(_=s)>>2]=c,i[_+4>>2]=h,i[(h=s+8|0)>>2]=0,i[s+12>>2]=e,i[s+20>>2]=t,i[s+24>>2]=n,r[s+28|0]=0,r[(c=s+29|0)|0]=0|r[p|0],r[c+1|0]=0|r[p+1|0],r[c+2|0]=0|r[p+2|0],i[s+16>>2]=3,y=+K(n),y*=+W(n),l=+u(+ +A[n>>3]),l=y/+f(+ +dn(+l,+ +u(+ +A[n+8>>3])))*6371.007180918475*6371.007180918475,n=0|i[(c=s+12|0)>>2];t:do{if((0|n)>0)do{if(pe(n+-1|0,d),!(l/+A[d>>3]>10))break t;n=(_=0|i[c>>2])+-1|0,i[c>>2]=n}while((0|_)>1)}while(0);if(Ne(s),i[(c=o)>>2]=0,i[c+4>>2]=0,!(!(0|(n=0|i[(c=s)>>2]))&!(0|(c=0|i[c+4>>2]))))do{Yt(n,c,e,d),p=d,p=0|en(0|i[(t=o)>>2],0|i[t+4>>2],0|i[p>>2],0|i[p+4>>2]),t=0|I(),i[(_=o)>>2]=p,i[_+4>>2]=t,Ne(s),n=0|i[(_=s)>>2],c=0|i[_+4>>2]}while(!(!(0|n)&!(0|c)));n=0|i[h>>2]}}while(0);return M=a,0|(_=n)},_memcpy:yn,_memset:_n,_originToDirectedEdges:function(t,e,n){n|=0;var r,A=0;return r=!(0|jt(t|=0,e|=0)),e&=-2130706433,i[(A=n)>>2]=r?t:0,i[A+4>>2]=r?285212672|e:0,i[(A=n+8|0)>>2]=t,i[A+4>>2]=301989888|e,i[(A=n+16|0)>>2]=t,i[A+4>>2]=318767104|e,i[(A=n+24|0)>>2]=t,i[A+4>>2]=335544320|e,i[(A=n+32|0)>>2]=t,i[A+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){t|=0,e|=0,r|=0;var A,o,s,a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,x=0,S=0,N=0,D=0,L=0,T=0,O=0,P=0,B=0,F=0,G=0;if(a=M,M=M+112|0,A=a+80|0,h=a+72|0,o=a,s=a+56|0,0|(u=0|Me(n|=0)))return M=a,0|(G=u);if(!(G=0|Je(32+(i[(p=t+8|0)>>2]<<5)|0)))return M=a,0|(G=13);if(Oe(t,G),!(u=0|Me(n))){if(F=0|i[(B=t)+4>>2],i[(u=h)>>2]=i[B>>2],i[u+4>>2]=F,Te(h,A),u=0|nt(A,e,o))B=0,F=0;else{if(u=0|i[h>>2],(0|(c=0|i[p>>2]))>0){l=0|i[t+12>>2],n=0;do{u=(0|i[l+(n<<3)>>2])+u|0,n=n+1|0}while((0|n)!=(0|c));n=u}else n=u;c=0|i[(u=o)>>2],(0|(u=0|i[u+4>>2]))<(0|(l=((0|n)<0)<<31>>31))|(0|u)==(0|l)&c>>>0<n>>>0?(i[(u=o)>>2]=n,i[u+4>>2]=l,u=l):n=c,B=0|en(0|n,0|u,12,0),F=0|I(),i[(u=o)>>2]=B,i[u+4>>2]=F,u=0}if(!u){if(!(n=0|tn(B,8)))return Ze(G),M=a,0|(G=13);if(!(f=0|tn(B,8)))return Ze(G),Ze(n),M=a,0|(G=13);i[(O=A)>>2]=0,i[O+4>>2]=0,P=0|i[(O=t)+4>>2],i[(u=h)>>2]=i[O>>2],i[u+4>>2]=P,u=0|Q(h,B,F,e,A,n,f);t:do{if(u)Ze(n),Ze(f),Ze(G);else{e:do{if((0|i[p>>2])>0){for(l=t+12|0,c=0;u=0|Q((0|i[l>>2])+(c<<3)|0,B,F,e,A,n,f),c=c+1|0,!(0|u);)if((0|c)>=(0|i[p>>2]))break e;Ze(n),Ze(f),Ze(G);break t}}while(0);(0|F)>0|!(0|F)&B>>>0>0&&_n(0|f,0,B<<3),O=0|i[(P=A)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|i[P>>2])>>>0>0){D=n,L=f,T=n,O=f,P=n,u=n,x=n,S=f,N=f,n=f;n:for(;;){for(b=0,w=0,E=0,C=0,c=0,l=0;;){h=(f=o)+56|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|h));if(0|R(p=0|i[(e=D+(b<<3)|0)>>2],e=0|i[e+4>>2],1,o,0)){h=(f=o)+56|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|h));0|(f=0|tn(7,4))&&(k(p,e,1,o,f,7,0,0),Ze(f))}for(v=0;;){_=0|i[(m=o+(v<<3)|0)>>2],m=0|i[m+4>>2];r:do{if(!(0|_)&!(0|m))f=c,h=l;else{if(d=0|un(0|_,0|m,0|B,0|F),p=0|I(),!(!(0|(h=0|i[(e=f=r+(d<<3)|0)>>2]))&!(0|(e=0|i[e+4>>2])))){g=0,y=0;do{if((0|g)>(0|F)|(0|g)==(0|F)&y>>>0>B>>>0)break n;if((0|h)==(0|_)&(0|e)==(0|m)){f=c,h=l;break r}d=0|an(0|(f=0|en(0|d,0|p,1,0)),0|I(),0|B,0|F),p=0|I(),y=0|en(0|y,0|g,1,0),g=0|I(),h=0|i[(e=f=r+(d<<3)|0)>>2],e=0|i[e+4>>2]}while(!(!(0|h)&!(0|e)))}if(!(0|_)&!(0|m)){f=c,h=l;break}ie(_,m,s),0|Pe(t,G,s)&&(y=0|en(0|c,0|l,1,0),l=0|I(),i[(g=f)>>2]=_,i[g+4>>2]=m,i[(c=L+(c<<3)|0)>>2]=_,i[c+4>>2]=m,c=y),f=c,h=l}}while(0);if((v=v+1|0)>>>0>=7)break;c=f,l=h}if(b=0|en(0|b,0|w,1,0),w=0|I(),E=0|en(0|E,0|C,1,0),C=0|I(),c=0|i[(l=A)>>2],!((0|C)<(0|(l=0|i[l+4>>2]))|(0|C)==(0|l)&E>>>0<c>>>0))break;c=f,l=h}if((0|l)>0|!(0|l)&c>>>0>0){c=0,l=0;do{i[(C=D+(c<<3)|0)>>2]=0,i[C+4>>2]=0,c=0|en(0|c,0|l,1,0),l=0|I(),E=0|i[(C=A)+4>>2]}while((0|l)<(0|E)|((0|l)==(0|E)?c>>>0<(0|i[C>>2])>>>0:0))}if(i[(C=A)>>2]=f,i[C+4>>2]=h,!((0|h)>0|!(0|h)&f>>>0>0))break e;v=n,b=N,w=P,E=S,C=L,n=x,N=u,S=T,x=v,u=b,P=O,O=w,T=E,L=D,D=C}Ze(T),Ze(O),Ze(G),u=1;break t}u=f}while(0);Ze(G),Ze(n),Ze(u),u=0}}while(0);return M=a,0|(G=u)}}return Ze(G),M=a,0|(G=u)},_polygonToCellsExperimental:function(t,e,n,r,A,o){r|=0,A|=0,o|=0;var s,a,u,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0;u=M,M=M+160|0,l=u+64|0,p=u+112|0,y=u,Se(h=u+80|0,t|=0,e|=0,n|=0),se(l,0|i[(f=h)>>2],0|i[f+4>>2],e),s=0|i[(f=l)>>2],f=0|i[f+4>>2],c=0|i[h+8>>2],i[(d=p+4|0)>>2]=i[h>>2],i[d+4>>2]=i[h+4>>2],i[d+8>>2]=i[h+8>>2],i[d+12>>2]=i[h+12>>2],i[d+16>>2]=i[h+16>>2],i[d+20>>2]=i[h+20>>2],i[d+24>>2]=i[h+24>>2],i[d+28>>2]=i[h+28>>2],i[(d=y)>>2]=s,i[d+4>>2]=f,i[(d=y+8|0)>>2]=c,e=p,n=(t=y+12|0)+36|0;do{i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}while((0|t)<(0|n));if(i[(p=y+48|0)>>2]=i[l>>2],i[p+4>>2]=i[l+4>>2],i[p+8>>2]=i[l+8>>2],i[p+12>>2]=i[l+12>>2],!(0|s)&!(0|f))return M=u,0|(y=c);n=y+16|0,a=y+24|0,h=y+28|0,c=0,l=0,e=s,t=f;do{if(!((0|c)<(0|A)|(0|c)==(0|A)&l>>>0<r>>>0)){g=4;break}if(f=l,l=0|en(0|l,0|c,1,0),c=0|I(),i[(f=o+(f<<3)|0)>>2]=e,i[f+4>>2]=t,ue(p),!(0|(e=0|i[(t=p)>>2]))&!(0|(t=0|i[t+4>>2]))){if(Ne(n),!(0|(t=0|i[(e=n)>>2]))&!(0|(e=0|i[e+4>>2]))){g=10;break}ae(t,e,0|i[h>>2],p),e=0|i[(t=p)>>2],t=0|i[t+4>>2]}i[(f=y)>>2]=e,i[f+4>>2]=t}while(!(!(0|e)&!(0|t)));return 4==(0|g)?(0|(e=0|i[(t=y+40|0)>>2])&&Ze(e),i[(g=y+16|0)>>2]=0,i[g+4>>2]=0,i[a>>2]=0,i[y+36>>2]=0,i[h>>2]=-1,i[y+32>>2]=0,i[t>>2]=0,ae(0,0,0,p),i[y>>2]=0,i[y+4>>2]=0,i[d>>2]=0,M=u,0|(y=14)):(10==(0|g)&&(i[y>>2]=0,i[y+4>>2]=0,i[d>>2]=i[a>>2]),y=0|i[d>>2],M=u,0|y)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|i[(t|=0)>>2])>>>0)+4294967296*+(0|i[t+4>>2]))},_res0CellCount:function(){return 122},_round:mn,_sbrk:vn,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,A,o,s){t|=0,r|=0,A|=0,o|=0;var a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(a=M,M=M+16|0,g=a,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return M=a,0|(g=0);if((0|(s|=0))>=16)return M=a,0|(g=12);p=0,d=0,h=0,u=0;t:for(;;){if(f=0|ln(0|(c=0|i[(l=t+(p<<3)|0)>>2]),0|(l=0|i[l+4>>2]),52),I(),(15&f)>(0|s)){u=12,c=11;break}if(se(g,c,l,s),!(0|(l=0|i[(f=g)>>2]))&!(0|(f=0|i[f+4>>2])))c=h;else{c=h;do{if(!((0|u)<(0|o)|(0|u)==(0|o)&c>>>0<A>>>0)){c=10;break t}i[(h=r+(c<<3)|0)>>2]=l,i[h+4>>2]=f,c=0|en(0|c,0|u,1,0),u=0|I(),ue(g),l=0|i[(h=g)>>2],f=0|i[h+4>>2]}while(!(!(0|l)&!(0|f)))}if(p=0|en(0|p,0|d,1,0),!((0|(d=0|I()))<(0|n)|(0|d)==(0|n)&p>>>0<e>>>0)){u=0,c=11;break}h=c}return 10==(0|c)?(M=a,0|(g=14)):11==(0|c)?(M=a,0|u):0},_uncompactCellsSize:function(t,e,n,r,A){t|=0,e|=0,n|=0,r|=0,A|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0;s=M,M=M+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(f=0,u=0,a=0,h=0;;){if(!(!(0|(c=0|i[(l=t+(f<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2]))||(l=!(0|Yt(c,l,r,o)),u=0|en(0|i[(c=o)>>2],0|i[c+4>>2],0|u,0|a),a=0|I(),l))){a=12;break}if(f=0|en(0|f,0|h,1,0),!((0|(h=0|I()))<(0|n)|(0|h)==(0|n)&f>>>0<e>>>0))break t}return M=s,0|a}u=0,a=0}while(0);return i[A>>2]=u,i[A+4>>2]=a,M=s,0|(A=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,A,o,s,a=0,u=0;return s=M,M=M+192|0,A=s,o=s+168|0,a=0|ln(0|(t|=0),0|(e|=0),56),I(),a&=7,0|(r=0|re(t,u=-2130706433&e|134217728,o))?(M=s,0|(u=r)):(e=0|ln(0|t,0|e,52),I(),e&=15,0|jt(t,u)?Rt(o,e,a,1,A):Gt(o,e,a,1,A),u=A+8|0,i[n>>2]=i[u>>2],i[n+4>>2]=i[u+4>>2],i[n+8>>2]=i[u+8>>2],i[n+12>>2]=i[u+12>>2],M=s,0|(u=0))},establishStackSpace:function(t,e){M=t|=0},stackAlloc:function(t){var e;return e=M,M=(M=M+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){M=t|=0},stackSave:function(){return 0|M}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{b:function(t){a=t},c:function(){return a},d:function(t,e,n,r){rt("Assertion failed: "+v(t)+", at: "+[e?v(e):"unknown filename",n,r?v(r):"unknown function"])},e:function(t){return n.___errno_location&&(g[n.___errno_location()>>2]=t),t},f:z,g:function(t,e,n){p.set(p.subarray(e,e+n),t)},h:function(t){var e=z(),n=16777216,r=2130706432;if(t>r)return!1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?b(2*i,n):Math.min(b((3*i+2147483648)/4,n),r);return!!function(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(h),j(e),w(e),1}catch(t){}}(i)},i:function(t){rt("OOM")},o:28640,p:28624},f);n.___divdi3=Y.___divdi3,n.___muldi3=Y.___muldi3,n.___remdi3=Y.___remdi3,n.___uremdi3=Y.___uremdi3,n._areNeighborCells=Y._areNeighborCells,n._bitshift64Ashr=Y._bitshift64Ashr,n._bitshift64Lshr=Y._bitshift64Lshr,n._bitshift64Shl=Y._bitshift64Shl,n._calloc=Y._calloc,n._cellAreaKm2=Y._cellAreaKm2,n._cellAreaM2=Y._cellAreaM2,n._cellAreaRads2=Y._cellAreaRads2,n._cellToBoundary=Y._cellToBoundary,n._cellToCenterChild=Y._cellToCenterChild,n._cellToChildPos=Y._cellToChildPos,n._cellToChildren=Y._cellToChildren,n._cellToChildrenSize=Y._cellToChildrenSize,n._cellToLatLng=Y._cellToLatLng,n._cellToLocalIj=Y._cellToLocalIj,n._cellToParent=Y._cellToParent,n._cellToVertex=Y._cellToVertex,n._cellToVertexes=Y._cellToVertexes,n._cellsToDirectedEdge=Y._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=Y._cellsToLinkedMultiPolygon,n._childPosToCell=Y._childPosToCell,n._compactCells=Y._compactCells,n._constructCell=Y._constructCell,n._destroyLinkedMultiPolygon=Y._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=Y._directedEdgeToBoundary,n._directedEdgeToCells=Y._directedEdgeToCells,n._edgeLengthKm=Y._edgeLengthKm,n._edgeLengthM=Y._edgeLengthM,n._edgeLengthRads=Y._edgeLengthRads;var j=n._emscripten_replace_memory=Y._emscripten_replace_memory;n._free=Y._free,n._getBaseCellNumber=Y._getBaseCellNumber,n._getDirectedEdgeDestination=Y._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=Y._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=Y._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=Y._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=Y._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=Y._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=Y._getIcosahedronFaces,n._getIndexDigit=Y._getIndexDigit,n._getNumCells=Y._getNumCells,n._getPentagons=Y._getPentagons,n._getRes0Cells=Y._getRes0Cells,n._getResolution=Y._getResolution,n._greatCircleDistanceKm=Y._greatCircleDistanceKm,n._greatCircleDistanceM=Y._greatCircleDistanceM,n._greatCircleDistanceRads=Y._greatCircleDistanceRads,n._gridDisk=Y._gridDisk,n._gridDiskDistances=Y._gridDiskDistances,n._gridDistance=Y._gridDistance,n._gridPathCells=Y._gridPathCells,n._gridPathCellsSize=Y._gridPathCellsSize,n._gridRing=Y._gridRing,n._gridRingUnsafe=Y._gridRingUnsafe,n._i64Add=Y._i64Add,n._i64Subtract=Y._i64Subtract,n._isPentagon=Y._isPentagon,n._isResClassIII=Y._isResClassIII,n._isValidCell=Y._isValidCell,n._isValidDirectedEdge=Y._isValidDirectedEdge,n._isValidIndex=Y._isValidIndex,n._isValidVertex=Y._isValidVertex,n._latLngToCell=Y._latLngToCell,n._llvm_ctlz_i64=Y._llvm_ctlz_i64,n._llvm_maxnum_f64=Y._llvm_maxnum_f64,n._llvm_minnum_f64=Y._llvm_minnum_f64,n._llvm_round_f64=Y._llvm_round_f64,n._localIjToCell=Y._localIjToCell,n._malloc=Y._malloc,n._maxFaceCount=Y._maxFaceCount,n._maxGridDiskSize=Y._maxGridDiskSize,n._maxPolygonToCellsSize=Y._maxPolygonToCellsSize,n._maxPolygonToCellsSizeExperimental=Y._maxPolygonToCellsSizeExperimental,n._memcpy=Y._memcpy,n._memset=Y._memset,n._originToDirectedEdges=Y._originToDirectedEdges,n._pentagonCount=Y._pentagonCount,n._polygonToCells=Y._polygonToCells,n._polygonToCellsExperimental=Y._polygonToCellsExperimental,n._readInt64AsDoubleFromPointer=Y._readInt64AsDoubleFromPointer,n._res0CellCount=Y._res0CellCount,n._round=Y._round,n._sbrk=Y._sbrk,n._sizeOfCellBoundary=Y._sizeOfCellBoundary,n._sizeOfCoordIJ=Y._sizeOfCoordIJ,n._sizeOfGeoLoop=Y._sizeOfGeoLoop,n._sizeOfGeoPolygon=Y._sizeOfGeoPolygon,n._sizeOfH3Index=Y._sizeOfH3Index,n._sizeOfLatLng=Y._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=Y._sizeOfLinkedGeoPolygon,n._uncompactCells=Y._uncompactCells,n._uncompactCellsSize=Y._uncompactCellsSize,n._vertexToLatLng=Y._vertexToLatLng,n.establishStackSpace=Y.establishStackSpace;var H,X,W=n.stackAlloc=Y.stackAlloc,$=n.stackRestore=Y.stackRestore,K=n.stackSave=Y.stackSave;if(n.asm=Y,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every(function(t){return"number"===t});return"string"!==e&&i&&!r?c(t):function(){return l(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":h[t|0]=e;break;case"i16":d[t>>1]=e;break;case"i32":g[t>>2]=e;break;case"i64":F=[e>>>0,(B=e,+T(B)>=1?B>0?(0|P(+O(B/4294967296),4294967295))>>>0:~~+M((B-+(~~B>>>0))/4294967296)>>>0:0)],g[t>>2]=F[0],g[t+4>>2]=F[1];break;case"float":y[t>>2]=e;break;case"double":_[t>>3]=e;break;default:rt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return h[t|0];case"i16":return d[t>>1];case"i32":case"i64":return g[t>>2];case"float":return y[t>>2];case"double":return _[t>>3];default:rt("invalid type for getValue: "+e)}return null},G){Q(G)||(H=G,G=n.locateFile?n.locateFile(H,A):A+H),R++,n.monitorRunDependencies&&n.monitorRunDependencies(R);var J=function(t){t.byteLength&&(t=new Uint8Array(t)),p.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(R--,n.monitorRunDependencies&&n.monitorRunDependencies(R),0==R&&k){var t=k;k=null,t()}}()},Z=function(){i(G,J,function(){throw"could not load memory initializer "+G})},tt=V(G);if(tt)J(tt.buffer);else if(n.memoryInitializerRequest){var et=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=V(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+G),void Z();e=r.buffer}J(e)};n.memoryInitializerRequest.response?setTimeout(et,0):n.memoryInitializerRequest.addEventListener("load",et)}else Z()}function nt(t){function e(){X||(X=!0,u||(C(x),C(S),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)L(n.postRun.shift());C(N)}()))}R>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)D(n.preRun.shift());C(I)}(),R>0||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),e()},1)):e()))}function rt(t){throw n.onAbort&&n.onAbort(t),o(t+=""),s(t),u=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(k=function t(){X||nt(),X||(k=t)},n.run=nt,n.abort=rt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return nt(),t}("object"==typeof e?e:{}),n="number",r={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid",16:"Index argument was not valid",17:"Base cell number was outside of acceptable range",18:"Child indexing digits invalid",19:"Child indexing digits refer to a deleted subsequence"},i={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};function A(t,e,n){var r=n&&"value"in n,i=new Error((t[e]||"Unknown error")+" (code: "+e+(r?", value: "+n.value:"")+")");return i.code=e,i}function o(t,e){return A(r,t,2===arguments.length?{value:e}:{})}function s(t,e){return A(i,t,2===arguments.length?{value:e}:{})}function a(t){if(0!==t)throw o(t)}var u={};[["sizeOfH3Index",n],["sizeOfLatLng",n],["sizeOfCellBoundary",n],["sizeOfGeoLoop",n],["sizeOfGeoPolygon",n],["sizeOfLinkedGeoPolygon",n],["sizeOfCoordIJ",n],["readInt64AsDoubleFromPointer",n],["isValidCell",n,[n,n]],["isValidIndex",n,[n,n]],["latLngToCell",n,[n,n,n,n]],["cellToLatLng",n,[n,n,n]],["cellToBoundary",n,[n,n,n]],["maxGridDiskSize",n,[n,n]],["gridDisk",n,[n,n,n,n]],["gridDiskDistances",n,[n,n,n,n,n]],["gridRing",n,[n,n,n,n]],["gridRingUnsafe",n,[n,n,n,n]],["maxPolygonToCellsSize",n,[n,n,n,n]],["polygonToCells",n,[n,n,n,n]],["maxPolygonToCellsSizeExperimental",n,[n,n,n,n]],["polygonToCellsExperimental",n,[n,n,n,n,n,n]],["cellsToLinkedMultiPolygon",n,[n,n,n]],["destroyLinkedMultiPolygon",null,[n]],["compactCells",n,[n,n,n,n]],["uncompactCells",n,[n,n,n,n,n,n]],["uncompactCellsSize",n,[n,n,n,n,n]],["isPentagon",n,[n,n]],["isResClassIII",n,[n,n]],["getBaseCellNumber",n,[n,n]],["getResolution",n,[n,n]],["getIndexDigit",n,[n,n,n]],["constructCell",n,[n,n,n,n]],["maxFaceCount",n,[n,n,n]],["getIcosahedronFaces",n,[n,n,n]],["cellToParent",n,[n,n,n,n]],["cellToChildren",n,[n,n,n,n]],["cellToCenterChild",n,[n,n,n,n]],["cellToChildrenSize",n,[n,n,n,n]],["cellToChildPos",n,[n,n,n,n]],["childPosToCell",n,[n,n,n,n,n,n]],["areNeighborCells",n,[n,n,n,n,n]],["cellsToDirectedEdge",n,[n,n,n,n,n]],["getDirectedEdgeOrigin",n,[n,n,n]],["getDirectedEdgeDestination",n,[n,n,n]],["isValidDirectedEdge",n,[n,n]],["directedEdgeToCells",n,[n,n,n]],["originToDirectedEdges",n,[n,n,n]],["directedEdgeToBoundary",n,[n,n,n]],["gridDistance",n,[n,n,n,n,n]],["gridPathCells",n,[n,n,n,n,n]],["gridPathCellsSize",n,[n,n,n,n,n]],["cellToLocalIj",n,[n,n,n,n,n,n]],["localIjToCell",n,[n,n,n,n,n]],["getHexagonAreaAvgM2",n,[n,n]],["getHexagonAreaAvgKm2",n,[n,n]],["getHexagonEdgeLengthAvgM",n,[n,n]],["getHexagonEdgeLengthAvgKm",n,[n,n]],["greatCircleDistanceM",n,[n,n]],["greatCircleDistanceKm",n,[n,n]],["greatCircleDistanceRads",n,[n,n]],["cellAreaM2",n,[n,n,n]],["cellAreaKm2",n,[n,n,n]],["cellAreaRads2",n,[n,n,n]],["edgeLengthM",n,[n,n,n]],["edgeLengthKm",n,[n,n,n]],["edgeLengthRads",n,[n,n,n]],["getNumCells",n,[n,n]],["getRes0Cells",n,[n]],["res0CellCount",n],["getPentagons",n,[n,n]],["pentagonCount",n],["cellToVertex",n,[n,n,n,n]],["cellToVertexes",n,[n,n,n]],["vertexToLatLng",n,[n,n,n]],["isValidVertex",n,[n,n]]].forEach(function(t){u[t[0]]=e.cwrap.apply(e,t)});var c=16,l=u.sizeOfH3Index(),f=u.sizeOfLatLng(),h=u.sizeOfCellBoundary(),p=u.sizeOfGeoPolygon(),d=u.sizeOfGeoLoop();function g(t){if(!t)throw s(1002);return t}u.sizeOfLinkedGeoPolygon(),u.sizeOfCoordIJ();var y=Math.pow(2,32)-1;var _=/[^0-9a-fA-F]/;function m(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||_.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),c);return[parseInt(t.substring(t.length-8),c),e]}function v(t){if(t>=0)return t.toString(c);var e=b(8,(t&=2147483647).toString(c));return e=(parseInt(e[0],c)+8).toString(c)+e.substring(1)}function b(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}var w=Math.pow(2,32);function E(t,n,r){for(var i=t.length,A=e._calloc(i,f),o=r?1:0,s=r?0:1,a=0;a<2*i;a+=2)e.HEAPF64.set([t[a/2][o],t[a/2][s]].map(M),A/8+a);return e.HEAPU32.set([i,A],n/4),n}function C(t,n){void 0===n&&(n=0);var r=e.getValue(t+l*n,"i32"),i=e.getValue(t+l*n+4,"i32");return i?function(t,e){return v(e)+b(8,v(t))}(r,i):null}function I(t){return function(t){return 180*t/Math.PI}(e.getValue(t,"double"))}function x(t){return[I(t+8),I(t)]}function S(t,n,r){var i=e._malloc(f);e.HEAPF64.set([t,n].map(M),i/8);var A=e._malloc(l);try{return a(u.latLngToCell(i,r,A)),g(C(A))}finally{e._free(A),e._free(i)}}function N(t,n){var r=e._malloc(h),i=m(t),A=i[0],o=i[1];try{return a(u.cellToBoundary(A,o,r)),function(t){for(var n=e.getValue(t,"i32"),r=t+8,i=[],A=x,o=0;o<2*n;o+=2)i.push(A(r+8*o));return i.push(i[0]),i}(r)}finally{e._free(r)}}function D(t,n){var r=m(t),i=r[0],A=r[1],o=e._malloc(l);try{return a(u.cellToParent(i,A,n,o)),g(C(o))}finally{e._free(o)}}function L(t,n,r){var i,A="number"!=typeof(i=t)?[0,0]:[0|i,i/w|0],o=A[0],s=A[1],c=m(n),f=c[0],h=c[1],p=e._malloc(l);try{return a(u.childPosToCell(o,s,f,h,r,p)),g(C(p))}finally{e._free(p)}}function T(t,n,r){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw o(4,t)}(n),r=Boolean(r),0===t.length||0===t[0].length)return[];var i,A=function(t,n){var r,i=t.length-1,A=e._calloc(p),o=0+d,s=o+4;if(E(t[0],A+0,n),i>0){r=e._calloc(i,d);for(var a=0;a<i;a++)E(t[a+1],r+d*a,n)}return e.setValue(A+o,i,"i32"),e.setValue(A+s,r,"i32"),A}("number"==typeof t[0][0]?[t]:t,r),c=e._malloc(8);try{a(u.maxPolygonToCellsSize(A,n,0,c));var f=function(t){if(t>y)throw s(1001,t);return t}((i=c,u.readInt64AsDoubleFromPointer(i))),h=e._calloc(f,l);try{return a(u.polygonToCells(A,n,0,h)),function(t,e){for(var n=[],r=0;r<e;r++){var i=C(t,r);null!==i&&n.push(i)}return n}(h,f)}finally{e._free(h)}}finally{e._free(c),function(t){var n=0+d,r=n+4;e._free(e.getValue(t+0+4,"i8*"));var i=e.getValue(t+n,"i32");if(i>0){for(var A=e.getValue(t+r,"i32"),o=0;o<i;o++)e._free(e.getValue(A+d*o+4,"i8*"));e._free(A)}e._free(t)}(A)}}function M(t){return t*Math.PI/180}const O={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE",CORRIDOR:"CORRIDOR"},P={[O.LARGE]:2,[O.MEDIUM]:4,[O.SMALL]:1/0},R=0,k=52,B={HOURS_AGO:2,SEVERITY:0,ALT_FROM:R,ALT_TO:k},F={[O.SMALL]:1,[O.MEDIUM]:0,[O.LARGE]:0,[O.CORRIDOR]:1},G={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},U={DATA:"/observations/v5/hexagons/{resolution}/{hexId}"},Q={[O.SMALL]:0,[O.MEDIUM]:1,[O.LARGE]:1,[O.CORRIDOR]:1},z={[O.SMALL]:2,[O.MEDIUM]:1,[O.LARGE]:2.5,[O.CORRIDOR]:1},q="polygon",V="isCorridorMode",Y="aircraftCategory",j=(t={icao:"",mapping:[]})=>{const{icao:e,mapping:n}=t;if(!e||!n||0===n.length)return G.C60;const r=n.find(t=>t.icao.toUpperCase()===e.toUpperCase())?.group;return r||G.C60},H=({value:t})=>void 0===t,X=({fn:t})=>"function"==typeof t,W=({value:t})=>"object"==typeof t,$=({time:t})=>{let e;const n=()=>{clearTimeout(e),e=null};return{run:r=>{n(),e=setTimeout(r,t)},cancel:n}},K=({current:t,next:e})=>{if(H({value:e}))return!1;const n=W({value:e}),r=Array.isArray(e);return n&&!r?Object.keys(e).some(n=>K({current:t?.[n],next:e[n]})):r?e.some((e,n)=>K({current:t?.[n],next:e})):t!==e},J=({current:t,next:e})=>Object.keys(e).reduce((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t),{...t}),Z=({current:t,next:e})=>{const n=new Set,r=!H({value:t})&&W({value:t});if(!(!H({value:e})&&W({value:e})))return n;const i=Object.keys(e);return r?(i.forEach(r=>{K({current:t[r],next:e[r]})&&n.add(r)}),n):(i.forEach(t=>n.add(t)),n)},tt=({edrValue:t})=>null==t||isNaN(t)||t<=.13?0:t<=.18?1:t<=.25?2:t<=.4?3:4;var et=Object.freeze({__proto__:null,buildDataKeyFromComponents:({components:t,separator:e="-"})=>t.join(e),debounce:({fn:t,delay:e})=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}},getChangedFields:Z,getSeverityValueByEdrValue:tt,getTimer:$,isChanged:K,isFunction:X,isObject:W,isUndefined:H,mapAircraftIcaoToAircraftType:j,mergeByProperty:({target:t,source:e,propName:n})=>{const r=[...t];return e.forEach(t=>{let e=r.find(e=>t[n]===e[n]);e?Object.assign(e,t):r.push(t)}),r},mergeWithoutUndefined:J,parseDataKeyToComponents:({dataKey:t,separator:e="-"})=>t.split(e),throttle:({fn:t,delay:e})=>{let n=0;return(...r)=>{const i=(new Date).getTime();i-n<e||(n=i,t(...r))}}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rt={exports:{}};rt.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",A="minute",o="hour",s="day",a="week",u="month",c="quarter",l="year",f="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},_={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),A=n-i<0,o=e.clone().add(r+(A?-1:1),u);return+(-(r+(n-i)/(A?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:l,w:a,d:s,D:f,h:o,m:A,s:i,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=g;var b="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[b])},E=function t(e,n,r){var i;if(!e)return m;if("string"==typeof e){var A=e.toLowerCase();v[A]&&(i=A),n&&(v[A]=n,i=A);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var s=e.name;v[s]=e,i=s}return!r&&i&&(m=i),i||!r&&m},C=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},I=_;I.l=E,I.i=w,I.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=E(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(I.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,A=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,A)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,A)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return I},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(t,e){var n=C(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return C(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<C(t)},y.$g=function(t,e,n){return I.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!I.u(e)||e,c=I.p(t),h=function(t,e){var i=I.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(s)},p=function(t,e){return I.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},d=this.$W,g=this.$M,y=this.$D,_="set"+(this.$u?"UTC":"");switch(c){case l:return r?h(1,0):h(31,11);case u:return r?h(1,g):h(0,g+1);case a:var m=this.$locale().weekStart||0,v=(d<m?d+7:d)-m;return h(r?y-v:y+(6-v),g);case s:case f:return p(_+"Hours",0);case o:return p(_+"Minutes",1);case A:return p(_+"Seconds",2);case i:return p(_+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,a=I.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[l]=c+"FullYear",n[o]=c+"Hours",n[A]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[a],p=a===s?this.$D+(e-this.$W):e;if(a===u||a===l){var d=this.clone().set(f,1);d.$d[h](p),d.init(),this.$d=d.set(f,Math.min(this.$D,d.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[I.p(t)]()},y.add=function(r,c){var f,h=this;r=Number(r);var p=I.p(c),d=function(t){var e=C(h);return I.w(e.date(e.date()+Math.round(t*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===l)return this.set(l,this.$y+r);if(p===s)return d(1);if(p===a)return d(7);var g=(f={},f[A]=e,f[o]=n,f[i]=t,f)[p]||1,y=this.$d.getTime()+r*g;return I.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=I.z(this),A=this.$H,o=this.$m,s=this.$M,a=n.weekdays,u=n.months,c=n.meridiem,l=function(t,n,i,A){return t&&(t[n]||t(e,r))||i[n].slice(0,A)},f=function(t){return I.s(A%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(d,function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return I.s(e.$y,4,"0");case"M":return s+1;case"MM":return I.s(s+1,2,"0");case"MMM":return l(n.monthsShort,s,u,3);case"MMMM":return l(u,s);case"D":return e.$D;case"DD":return I.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(n.weekdaysMin,e.$W,a,2);case"ddd":return l(n.weekdaysShort,e.$W,a,3);case"dddd":return a[e.$W];case"H":return String(A);case"HH":return I.s(A,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(A,o,!0);case"A":return p(A,o,!1);case"m":return String(o);case"mm":return I.s(o,2,"0");case"s":return String(e.$s);case"ss":return I.s(e.$s,2,"0");case"SSS":return I.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,f,h){var p,d=this,g=I.p(f),y=C(r),_=(y.utcOffset()-this.utcOffset())*e,m=this-y,v=function(){return I.m(d,y)};switch(g){case l:p=v()/12;break;case u:p=v();break;case c:p=v()/3;break;case a:p=(m-_)/6048e5;break;case s:p=(m-_)/864e5;break;case o:p=m/n;break;case A:p=m/e;break;case i:p=m/t;break;default:p=m}return h?p:I.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return v[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=E(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return I.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),S=x.prototype;return C.prototype=S,[["$ms",r],["$s",i],["$m",A],["$H",o],["$W",s],["$M",u],["$y",l],["$D",f]].forEach(function(t){S[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),C.extend=function(t,e){return t.$i||(t(e,x,C),t.$i=!0),C},C.locale=E,C.isDayjs=w,C.unix=function(t){return C(1e3*t)},C.en=v[m],C.Ls=v,C.p={},C}();var it=nt(rt.exports),At=6371008.8,ot={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*At,kilometers:6371.0088,kilometres:6371.0088,meters:At,metres:At,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:At/1852,radians:1,yards:6967335.223679999};function st(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function at(t,e,n){if(void 0===n&&(n={}),!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(!dt(t[0])||!dt(t[1]))throw new Error("coordinates must contain numbers");return st({type:"Point",coordinates:t},e,n)}function ut(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var A=i[r];if(A.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<A[A.length-1].length;o++)if(A[A.length-1][o]!==A[0][o])throw new Error("First and last Position are not equivalent.")}return st({type:"Polygon",coordinates:t},e,n)}function ct(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function lt(t,e){void 0===e&&(e="kilometers");var n=ot[e];if(!n)throw new Error(e+" units is invalid");return t*n}function ft(t,e){void 0===e&&(e="kilometers");var n=ot[e];if(!n)throw new Error(e+" units is invalid");return t/n}function ht(t){return t%360*Math.PI/180}function pt(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return lt(ft(t,e),n)}function dt(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function gt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return yt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return yt(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return mt(t);default:throw new Error("unknown GeoJSON type")}}function yt(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=_t(t.properties),e.geometry=mt(t.geometry),e}function _t(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map(function(t){return t}):e[n]=_t(r):e[n]=r}),e):e}function mt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return mt(t)}),e):(e.coordinates=vt(t.coordinates),e)}function vt(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map(function(t){return vt(t)})}function bt(t,e,n){if(null!==t)for(var r,i,A,o,s,a,u,c,l=0,f=0,h=t.type,p="FeatureCollection"===h,d="Feature"===h,g=p?t.features.length:1,y=0;y<g;y++){s=(c=!!(u=p?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var _=0;_<s;_++){var m=0,v=0;if(null!==(o=c?u.geometries[_]:u)){a=o.coordinates;var b=o.type;switch(l=!n||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===e(a,f,y,m,v))return!1;f++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<a.length;r++){if(!1===e(a[r],f,y,m,v))return!1;f++,"MultiPoint"===b&&m++}"LineString"===b&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<a.length;r++){for(i=0;i<a[r].length-l;i++){if(!1===e(a[r][i],f,y,m,v))return!1;f++}"MultiLineString"===b&&m++,"Polygon"===b&&v++}"Polygon"===b&&m++;break;case"MultiPolygon":for(r=0;r<a.length;r++){for(v=0,i=0;i<a[r].length;i++){for(A=0;A<a[r][i].length-l;A++){if(!1===e(a[r][i][A],f,y,m,v))return!1;f++}v++}m++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===bt(o.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function wt(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Et(t,e){var n,r,i,A,o,s,a,u,c,l,f=0,h="FeatureCollection"===t.type,p="Feature"===t.type,d=h?t.features.length:1;for(n=0;n<d;n++){for(s=h?t.features[n].geometry:p?t.geometry:t,u=h?t.features[n].properties:p?t.properties:{},c=h?t.features[n].bbox:p?t.bbox:void 0,l=h?t.features[n].id:p?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(A=a?s.geometries[i]:s))switch(A.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(A,f,u,c,l))return!1;break;case"GeometryCollection":for(r=0;r<A.geometries.length;r++)if(!1===e(A.geometries[r],f,u,c,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,u,c,l))return!1;f++}}function Ct(t){var e=[1/0,1/0,-1/0,-1/0];return bt(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}function It(t,e){void 0===e&&(e={});var n=Ct(t);return at([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}function xt(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function St(t,e){var n=ht(t[1]),r=ht(e[1]),i=ht(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var A=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(function(t){return t%(2*Math.PI)*180/Math.PI}(Math.atan2(i,A))+360)%360}function Nt(t,e,n){void 0===n&&(n={});var r=xt(t),i=xt(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var A=function(t,e,n){var r=n=void 0===n?At:Number(n),i=t[1]*Math.PI/180,A=e[1]*Math.PI/180,o=A-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var a=Math.log(Math.tan(A/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),u=Math.abs(a)>1e-11?o/a:Math.cos(i);return Math.sqrt(o*o+u*u*s*s)*r}(r,i);return pt(A,"meters",n.units)}function Dt(t,e,n,r){void 0===r&&(r={});var i=e<0,A=pt(Math.abs(e),r.units,"meters");i&&(A=-Math.abs(A));var o=xt(t),s=function(t,e,n,r){r=void 0===r?At:Number(r);var i=e/r,A=t[0]*Math.PI/180,o=ht(t[1]),s=ht(n),a=i*Math.cos(s),u=o+a;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),l=Math.abs(c)>1e-11?a/c:Math.cos(o),f=i*Math.sin(s)/l;return[(180*(A+f)/Math.PI+540)%360-180,180*u/Math.PI]}(o,A,n);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,at(s,r.properties)}function Lt(t,e,n){if(!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,i=n.origin,A=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(i)||"object"==typeof i;return!0!==A&&(t=gt(t)),"FeatureCollection"!==t.type||o?Tt(t,e,i):(wt(t,function(n,r){t.features[r]=Tt(n,e,i)}),t)}function Tt(t,e,n){var r,i="Point"===("FeatureCollection"===(r=t).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":"Feature"===r.type&&null!==r.geometry?r.geometry.type:r.type);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return xt(e);var n=t.bbox?t.bbox:Ct(t),r=n[0],i=n[1],A=n[2],o=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return at([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return at([A,i]);case"nw":case"northwest":case"westnorth":case"topleft":return at([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return at([A,o]);case"center":return It(t);case void 0:case null:case"centroid":return function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return bt(t,function(t){n+=t[0],r+=t[1],i++},!0),at([n/i,r/i],e.properties)}(t);default:throw new Error("invalid origin")}}(t,n),1===e||i||bt(t,function(t){var r,i,A,o,s=Nt(n,t),a=(r=n,i=t,void 0===A&&(A={}),(o=A.final?St(xt(i),xt(r)):St(xt(r),xt(i)))>180?-(360-o):o),u=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Dt(n,s*e,a));t[0]=u[0],t[1]=u[1],3===t.length&&(t[2]*=e)}),t}Ct.default=Ct;var Mt={exports:{}};(function(t){function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function A(){}function o(t){return null===t?Pt:t.color}function s(t){return null===t?null:t.parent}function a(t,e){null!==t&&(t.color=e)}function u(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function l(){this.root_=null,this.size_=0}function f(){}function h(){this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}function p(){}function d(t){this.message=t||""}function g(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)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 i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},v={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},v.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,v);var b=function(){},w=function(){},E=function(){},C=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},I={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};C.prototype.setOrdinate=function(t,e){switch(t){case C.X:this.x=e;break;case C.Y:this.y=e;break;case C.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},C.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!y.equalsWithTolerance(this.x,e.x,n)&&!!y.equalsWithTolerance(this.y,e.y,n)}},C.prototype.getOrdinate=function(t){switch(t){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.z}throw new _("Invalid ordinate index: "+t)},C.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},C.prototype.equals=function(t){return t instanceof C&&this.equals2D(t)},C.prototype.equalInZ=function(t,e){return y.equalsWithTolerance(this.z,t.z,e)},C.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},C.prototype.clone=function(){},C.prototype.copy=function(){return new C(this)},C.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},C.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)},C.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},C.prototype.hashCode=function(){var t=17;return 37*(t=37*t+C.hashCode(this.x))+C.hashCode(this.y)},C.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},C.prototype.interfaces_=function(){return[b,w,e]},C.prototype.getClass=function(){return C},C.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=m.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},I.DimensionalComparator.get=function(){return x},I.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},I.NULL_ORDINATE.get=function(){return m.NaN},I.X.get=function(){return 0},I.Y.get=function(){return 1},I.Z.get=function(){return 2},Object.defineProperties(C,I);var x=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};x.prototype.compare=function(t,e){var n=t,r=e,i=x.compare(n.x,r.x);if(0!==i)return i;var A=x.compare(n.y,r.y);return 0!==A?A:this._dimensionsToTest<=2?0:x.compare(n.z,r.z)},x.prototype.interfaces_=function(){return[E]},x.prototype.getClass=function(){return x},x.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var S=function(){};S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S};var N=function(){},D={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N},N.toLocationSymbol=function(t){switch(t){case N.EXTERIOR:return"e";case N.BOUNDARY:return"b";case N.INTERIOR:return"i";case N.NONE:return"-"}throw new _("Unknown location value: "+t)},D.INTERIOR.get=function(){return 0},D.BOUNDARY.get=function(){return 1},D.EXTERIOR.get=function(){return 2},D.NONE.get=function(){return-1},Object.defineProperties(N,D);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},T=function(){},M={LOG_10:{configurable:!0}};T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},T.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],A=arguments[2];return r<i?i:r>A?A:r}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],A=arguments[3],o=arguments[0];return r>o&&(o=r),i>o&&(o=i),A>o&&(o=A),o}},T.average=function(t,e){return(t+e)/2},M.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,M);var O=function(t){this.str=t};O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str};var P=function(t){this.value=t};P.prototype.intValue=function(){return this.value},P.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},P.isNaN=function(t){return Number.isNaN(t)};var R=function(){};R.isWhitespace=function(t){return t<=32&&t>=0||127===t},R.toUpperCase=function(t){return t.toUpperCase()};var k=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},B={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}};k.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},k.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=k.magnitude(n._hi),i=k.TEN.pow(r);(n=n.divide(i)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var A=r+1,o=new O,s=k.MAX_PRINT_DIGITS-1,a=0;a<=s;a++){t&&a===A&&o.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,l=0;u>9?(c=!0,l="9"):l="0"+u,o.append(l),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var f=!0,h=k.magnitude(n._hi);if(h<0&&Math.abs(h)>=s-a&&(f=!1),!f)break}return e[0]=r,o.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},k.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},k.prototype.isZero=function(){return 0===this._hi&&0===this._lo},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(t){return this.le(t)?this:t},k.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,A=null,o=null,s=null,a=null,u=null,c=null,l=null;return a=this._hi/n,l=(i=(u=k.SPLIT*a)-(i=u-a))*(o=(l=k.SPLIT*n)-(o=l-n))-(c=a*n)+i*(s=n-o)+(A=a-i)*o+A*s,l=a+(u=(this._hi-c-l+this._lo-a*r)/n),this._hi=l,this._lo=a-l+u,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var t=arguments[0],e=null,n=null,r=null,i=null,A=null,o=null,s=null,a=null;return n=(A=this._hi/t._hi)-(e=(o=k.SPLIT*A)-(e=o-A)),a=e*(r=(a=k.SPLIT*t._hi)-(r=a-t._hi))-(s=A*t._hi)+e*(i=t._hi-r)+n*r+n*i,o=(this._hi-s-a+this._lo-A*t._lo)/t._hi,new k(a=A+o,A-a+o)}if("number"==typeof arguments[0]){var u=arguments[0];return m.isNaN(u)?k.createNaN():k.copy(this).selfDivide(u,0)}},k.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},k.prototype.pow=function(t){if(0===t)return k.valueOf(1);var e=new k(this),n=k.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new k(t,e)},k.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},k.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},k.prototype.max=function(t){return this.ge(t)?this:t},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=k.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},k.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,A=null,o=null,s=null;return A=(i=this._hi+e)-(o=i-this._hi),r=(s=(A=e-o+(this._hi-A))+this._lo)+(i-(n=i+s)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var a=arguments[0],u=arguments[1],c=null,l=null,f=null,h=null,p=null,d=null,g=null;h=this._hi+a,l=this._lo+u,p=h-(d=h-this._hi),f=l-(g=l-this._lo);var y=(c=h+(d=(p=a-d+(this._hi-p))+l))+(d=(f=u-g+(this._lo-f))+(d+(h-c))),_=d+(c-y);return this._hi=y,this._lo=_,this}},k.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,A=null,o=null,s=null,a=null,u=null;i=(a=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,i=a-i,A=this._hi-i,o=u-n;var c=(a=this._hi*n)+(u=i*(o=u-o)-a+i*(s=n-o)+A*o+A*s+(this._hi*r+this._lo*n)),l=u+(i=a-c);return this._hi=c,this._lo=l,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new k(t,e)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var t=arguments[0];return t.isNaN()?k.createNaN():k.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return m.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var t=k.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var A=r-n.length;i=n+k.stringOfChar("0",A)+".0"}return this.isNegative()?"-"+i:i},k.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,A=null,o=null,s=null;e=(i=1/this._hi)-(t=(A=k.SPLIT*i)-(t=A-i)),n=(s=k.SPLIT*this._hi)-this._hi;var a=i+(A=(1-(o=i*this._hi)-(s=t*(n=s-n)-o+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new k(a,i-a+A)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=k.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var A=n.charAt(0)+"."+i;return this.isNegative()?"-"+A+r:A+r},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},k.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var t=arguments[0];return k.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return k.copy(this).selfAdd(e)}},k.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof k){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},k.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},k.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[e,b,w]},k.prototype.getClass=function(){return k},k.sqr=function(t){return k.valueOf(t).selfMultiply(t)},k.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return k.parse(t)}if("number"==typeof arguments[0])return new k(arguments[0])},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;R.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var A=new k,o=0,s=0,a=0;!(e>=n);){var u=t.charAt(e);if(e++,R.isDigit(u)){var c=u-"0";A.selfMultiply(k.TEN),A.selfAdd(c),o++}else{if("."!==u){if("e"===u||"E"===u){var l=t.substring(e);try{a=P.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}s=o}}var f=A,h=o-s-a;if(0===h)f=A;else if(h>0){var p=k.TEN.pow(h);f=A.divide(p)}else if(h<0){var d=k.TEN.pow(-h);f=A.multiply(d)}return r?f.negate():f},k.createNaN=function(){return new k(m.NaN,m.NaN)},k.copy=function(t){return new k(t)},k.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},k.stringOfChar=function(t,e){for(var n=new O,r=0;r<e;r++)n.append(t);return n.toString()},B.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},B.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},B.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},B.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},B.NaN.get=function(){return new k(m.NaN,m.NaN)},B.EPS.get=function(){return 123259516440783e-46},B.SPLIT.get=function(){return 134217729},B.MAX_PRINT_DIGITS.get=function(){return 32},B.TEN.get=function(){return k.valueOf(10)},B.ONE.get=function(){return k.valueOf(1)},B.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},B.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,B);var F=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.orientationIndex=function(t,e,n){var r=F.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=k.valueOf(e.x).selfAdd(-t.x),A=k.valueOf(e.y).selfAdd(-t.y),o=k.valueOf(n.x).selfAdd(-e.x),s=k.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(s).selfSubtract(A.selfMultiply(o)).signum()},F.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},F.intersection=function(t,e,n,r){var i=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),A=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),o=i.subtract(A),s=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),a=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(a).selfDivide(o).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),l=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),f=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(f).selfDivide(o).doubleValue(),p=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(h)).doubleValue();return new C(c,p)},F.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),A=(t.y-n.y)*(e.x-n.x),o=i-A;if(i>0){if(A<=0)return F.signum(o);r=i+A}else{if(!(i<0))return F.signum(o);if(A>=0)return F.signum(o);r=-i-A}var s=F.DP_SAFE_EPSILON*r;return o>=s||-o>=s?F.signum(o):2},F.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,G);var U=function(){},Q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Q.X.get=function(){return 0},Q.Y.get=function(){return 1},Q.Z.get=function(){return 2},Q.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,n){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[w]},U.prototype.getClass=function(){return U},Object.defineProperties(U,Q);var z=function(){},q=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(z),V=function(){};V.arraycopy=function(t,e,n,r,i){for(var A=0,o=e;o<e+i;o++)n[r+A]=t[o],A++},V.getProperty=function(t){return{"line.separator":"\n"}[t]};var Y=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],A=arguments[1];this.x=i.y*A.w-A.y*i.w,this.y=A.x*i.w-i.x*A.w,this.w=i.x*A.y-A.x*i.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2];this.x=a,this.y=u,this.w=c}else if(4===arguments.length){var l=arguments[0],f=arguments[1],h=arguments[2],p=arguments[3],d=l.y-f.y,g=f.x-l.x,y=l.x*f.y-f.x*l.y,_=h.y-p.y,m=p.x-h.x,v=h.x*p.y-p.x*h.y;this.x=g*v-m*y,this.y=_*y-d*v,this.w=d*m-_*g}};Y.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new q;return t},Y.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new q;return t},Y.prototype.getCoordinate=function(){var t=new C;return t.x=this.getX(),t.y=this.getY(),t},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.intersection=function(t,e,n,r){var i=t.y-e.y,A=e.x-t.x,o=t.x*e.y-e.x*t.y,s=n.y-r.y,a=r.x-n.x,u=n.x*r.y-r.x*n.y,c=i*a-s*A,l=(A*u-a*o)/c,f=(s*o-i*u)/c;if(m.isNaN(l)||m.isInfinite(l)||m.isNaN(f)||m.isInfinite(f))throw new q;return new C(l,f)};var j=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(A,o,s,a)}},H={serialVersionUID:{configurable:!0}};j.prototype.getArea=function(){return this.getWidth()*this.getHeight()},j.prototype.equals=function(t){if(!(t instanceof j))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()},j.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new j;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,i=this._maxy<t._maxy?this._maxy:t._maxy;return new j(e,r,n,i)},j.prototype.isNull=function(){return this._maxx<this._minx},j.prototype.getMaxX=function(){return this._maxx},j.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof j){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},j.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof C){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},j.prototype.getMinY=function(){return this._miny},j.prototype.getMinX=function(){return this._minx},j.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof j){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(2===arguments.length){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))}},j.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},j.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},j.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},j.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},j.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},j.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},j.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},j.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},j.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){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()}},j.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},j.prototype.centre=function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},j.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3];i<A?(this._minx=i,this._maxx=A):(this._minx=A,this._maxx=i),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},j.prototype.getMaxY=function(){return this._maxy},j.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),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},j.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)},j.prototype.interfaces_=function(){return[b,e]},j.prototype.getClass=function(){return j},j.intersects=function(){if(3===arguments.length){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)}if(4===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2],o=arguments[3],s=Math.min(A.x,o.x),a=Math.max(A.x,o.x),u=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(u>a||c<s||(s=Math.min(A.y,o.y),a=Math.max(A.y,o.y),u=Math.min(r.y,i.y),c=Math.max(r.y,i.y),u>a||c<s))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(j,H);var X={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*$/},W=function(t){this.geometryFactory=t||new ye};W.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=X.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=X.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},W.prototype.write=function(t){return this.extractGeometry(t)},W.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!$[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+$[e].apply(this,[t])+")"};var $={coordinate:function(t){return t.x+" "+t.y},point:function(t){return $.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push($.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push($.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+$.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+$.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(X.spaces);return this.geometryFactory.createPoint(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,A=n.length;i<A;++i)e=n[i].replace(X.trimParens,"$1"),r.push(K.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,A=n.length;i<A;++i)e=n[i].trim().split(X.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,A=n.length;i<A;++i)e=n[i].trim().split(X.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(X.parenComma),r=[],i=0,A=n.length;i<A;++i)e=n[i].replace(X.trimParens,"$1"),r.push(K.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,A=t.trim().split(X.parenComma),o=[],s=0,a=A.length;s<a;++s)e=A[s].replace(X.trimParens,"$1"),n=K.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?i=r:o.push(r);return this.geometryFactory.createPolygon(i,o)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(X.doubleParenComma),r=[],i=0,A=n.length;i<A;++i)e=n[i].replace(X.trimParens,"$1"),r.push(K.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},J=function(t){this.parser=new W(t)};J.prototype.write=function(t){return this.parser.write(t)},J.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Z=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Z),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=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 C,this._intPt[1]=new C,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.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)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return J.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+J.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),A=-1;if(t.equals(e))A=0;else if(t.equals(n))A=r>i?r:i;else{var o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(A=r>i?o:s)||t.equals(e)||(A=Math.max(o,s))}return et.isTrue(!(0===A&&!t.equals(e)),"Bad distance calculation"),A},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,A=Math.sqrt(r*r+i*i);return et.isTrue(!(0===A&&!t.equals(e)),"Invalid distance calculation"),A},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new j(this._inputLines[0][0],this._inputLines[0][1]),n=new j(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,j.intersects(n,r,e)&&0===st.orientationIndex(n,r,e)&&0===st.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var A=null;try{A=Y.intersection(t,n,r,i)}catch(o){if(!(o instanceof q))throw o;A=e.nearestEndpoint(t,n,r,i)}return A},e.prototype.intersection=function(t,n,r,i){var A=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(A)||(A=new C(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(A),A},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,A=Math.abs(i);return Math.abs(e)<A&&(i=e,A=Math.abs(e)),Math.abs(n)<A&&(i=n,A=Math.abs(n)),Math.abs(r)<A&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var A=F.intersection(t,e,n,r),o=this.isInSegmentEnvelopes(A);V.out.println("DD in env = "+o+" --------------------- "+A),i.distance(A)>1e-4&&V.out.println("Distance = "+i.distance(A))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new C(t),A=new C(e),o=new C(n),s=new C(r),a=new C;this.normalizeToEnvCentre(i,A,o,s,a);var u=this.safeHCoordinateIntersection(i,A,o,s);return u.x+=a.x,u.y+=a.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,i){var A=j.intersects(e,n,r),o=j.intersects(e,n,i),s=j.intersects(r,i,e),a=j.intersects(r,i,n);return A&&o?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):A&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):A&&a?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||A||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||A||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var A=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,f=n.y>r.y?n.y:r.y,h=((A>u?A:u)+(s<l?s:l))/2,p=((o>c?o:c)+(a<f?a:f))/2;i.x=h,i.y=p,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!j.intersects(e,n,r,i))return t.NO_INTERSECTION;var A=st.orientationIndex(e,n,r),o=st.orientationIndex(e,n,i);if(A>0&&o>0||A<0&&o<0)return t.NO_INTERSECTION;var s=st.orientationIndex(r,i,e),a=st.orientationIndex(r,i,n);return s>0&&a>0||s<0&&a<0?t.NO_INTERSECTION:0===A&&0===o&&0===s&&0===a?this.computeCollinearIntersection(e,n,r,i):(0===A||0===o||0===s||0===a?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===A?this._intPt[0]=new C(r):0===o?this._intPt[0]=new C(i):0===s?this._intPt[0]=new C(e):0===a&&(this._intPt[0]=new C(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,A=st.distancePointLine(t,n,r),o=st.distancePointLine(e,n,r);return o<A&&(A=o,i=e),(o=st.distancePointLine(n,t,e))<A&&(A=o,i=n),(o=st.distancePointLine(r,t,e))<A&&(A=o,i=r),i},e}(nt),At=function(){};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,A=n.x-e.x,o=n.y-e.y;return At.signOfDet2x2(r,i,A,o)},At.signOfDet2x2=function(t,e,n,r){var i=null,A=null,o=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,A=t,t=n,n=A,A=e,e=r,r=A):e<=-r?(i=-i,n=-n,r=-r):(A=t,t=-n,n=A,A=e,e=-r,r=A):r>0?-e<=r?(i=-i,t=-t,e=-e):(A=-t,t=n,n=A,A=-e,e=r,r=A):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,A=-t,t=-n,n=A,A=-e,e=-r,r=A),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(o=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=o*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(o=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=o*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var ot=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ot.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 i=t.x-this._p.x,A=t.y-this._p.y,o=e.x-this._p.x,s=e.y-this._p.y,a=At.signOfDet2x2(i,A,o,s);if(0===a)return this._isPointOnSegment=!0,null;s<A&&(a=-a),a>0&&this._crossingCount++}},ot.prototype.isPointInPolygon=function(){return this.getLocation()!==N.EXTERIOR},ot.prototype.getLocation=function(){return this._isPointOnSegment?N.BOUNDARY:this._crossingCount%2==1?N.INTERIOR:N.EXTERIOR},ot.prototype.isOnSegment=function(){return this._isPointOnSegment},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.locatePointInRing=function(){if(arguments[0]instanceof C&&L(arguments[1],U)){for(var t=arguments[1],e=new ot(arguments[0]),n=new C,r=new C,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var A=arguments[1],o=new ot(arguments[0]),s=1;s<A.length;s++){var a=A[s],u=A[s-1];if(o.countSegment(a,u),o.isOnSegment())return o.getLocation()}return o.getLocation()}};var st=function(){},at={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){return F.orientationIndex(t,e,n)},st.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 i=t[r].x-n,A=t[r+1].y;e+=i*(t[r-1].y-A)}return e/2}if(L(arguments[0],U)){var o=arguments[0],s=o.size();if(s<3)return 0;var a=new C,u=new C,c=new C;o.getCoordinate(0,u),o.getCoordinate(1,c);var l=u.x;c.x-=l;for(var f=0,h=1;h<s-1;h++)a.y=u.y,u.x=c.x,u.y=c.y,o.getCoordinate(h+1,c),c.x-=l,f+=u.x*(a.y-c.y);return f/2}},st.distanceLineLine=function(t,e,n,r){if(t.equals(e))return st.distancePointLine(t,n,r);if(n.equals(r))return st.distancePointLine(r,t,e);var i=!1;if(j.intersects(t,e,n,r)){var A=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===A)i=!0;else{var o=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),s=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/A,a=o/A;(a<0||a>1||s<0||s>1)&&(i=!0)}}else i=!0;return i?T.min(st.distancePointLine(t,n,r),st.distancePointLine(e,n,r),st.distancePointLine(n,t,e),st.distancePointLine(r,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==N.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new C;t.getCoordinate(0,r);for(var i=r.x,A=r.y,o=1;o<e;o++){t.getCoordinate(o,r);var s=r.x,a=r.y,u=s-i,c=a-A;n+=Math.sqrt(u*u+c*c),i=s,A=a}return n},st.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var A=t[i];A.y>n.y&&(n=A,r=i)}var o=r;do{(o-=1)<0&&(o=e)}while(t[o].equals2D(n)&&o!==r);var s=r;do{s=(s+1)%e}while(t[s].equals2D(n)&&s!==r);var a=t[o],u=t[s];if(a.equals2D(n)||u.equals2D(n)||a.equals2D(u))return!1;var c=st.computeOrientation(a,n,u);return 0===c?a.x>u.x:c>0},st.locatePointInRing=function(t,e){return ot.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},st.computeOrientation=function(t,e,n){return st.orientationIndex(t,e,n)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=st.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return A.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((A.x-o.x)*(s.x-o.x)+(A.y-o.y)*(s.y-o.y))/a;if(u<=0)return A.distance(o);if(u>=1)return A.distance(s);var c=((o.y-A.y)*(s.x-o.x)-(o.x-A.x)*(s.y-o.y))/a;return Math.abs(c)*Math.sqrt(a)}},st.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],A=e[r];if(n.computeIntersection(t,i,A),n.hasIntersection())return!0}return!1},at.CLOCKWISE.get=function(){return-1},at.RIGHT.get=function(){return st.CLOCKWISE},at.COUNTERCLOCKWISE.get=function(){return 1},at.LEFT.get=function(){return st.COUNTERCLOCKWISE},at.COLLINEAR.get=function(){return 0},at.STRAIGHT.get=function(){return st.COLLINEAR},Object.defineProperties(st,at);var ut=function(){};ut.prototype.filter=function(t){},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},lt={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}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){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)}if(2===arguments.length){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)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new j(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),A=r.next(),o=i.compareTo(A);if(0!==o)return o}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,b,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},lt.serialVersionUID.get=function(){return 0x799ea46522854c00},lt.SORTINDEX_POINT.get=function(){return 0},lt.SORTINDEX_MULTIPOINT.get=function(){return 1},lt.SORTINDEX_LINESTRING.get=function(){return 2},lt.SORTINDEX_LINEARRING.get=function(){return 3},lt.SORTINDEX_MULTILINESTRING.get=function(){return 4},lt.SORTINDEX_POLYGON.get=function(){return 5},lt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},lt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},lt.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ct,lt);var ft=function(){};ft.interfaces_=function(){return[ut]},ft.filter=function(t){t.geometryChangedAction()};var ht=function(){};ht.prototype.filter=function(t){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht};var pt=function(){},dt={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}};pt.prototype.isInBoundary=function(t){},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},dt.Mod2BoundaryNodeRule.get=function(){return gt},dt.EndPointBoundaryNodeRule.get=function(){return yt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MOD2_BOUNDARY_RULE.get=function(){return new gt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new yt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return pt.MOD2_BOUNDARY_RULE},Object.defineProperties(pt,dt);var gt=function(){};gt.prototype.isInBoundary=function(t){return t%2==1},gt.prototype.interfaces_=function(){return[pt]},gt.prototype.getClass=function(){return gt};var yt=function(){};yt.prototype.isInBoundary=function(t){return t>0},yt.prototype.interfaces_=function(){return[pt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[pt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[pt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.add=function(){},vt.prototype.addAll=function(){},vt.prototype.isEmpty=function(){},vt.prototype.iterator=function(){},vt.prototype.size=function(){},vt.prototype.toArray=function(){},vt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vt);(r.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ct(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),Ct=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(bt),It=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof C&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var A=arguments[0],o=arguments[1];return this.add(A,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];if(arguments[2])for(var u=0;u<s.length;u++)this.add(s[u],a);else for(var c=s.length-1;c>=0;c--)this.add(s[c],a);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var l=arguments[0],f=arguments[1];if(!arguments[2]){var h=this.size();if(h>0){if(l>0&&this.get(l-1).equals2D(f))return null;if(l<h&&this.get(l).equals2D(f))return null}}t.prototype.add.call(this,l,f)}}else if(4===arguments.length){var p=arguments[0],d=arguments[1],g=arguments[2],y=arguments[3],_=1;g>y&&(_=-1);for(var m=g;m!==y;m+=_)this.add(p[m],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new C(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Et),xt=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};St.ForwardComparator.get=function(){return Nt},St.BidirectionalComparator.get=function(){return Dt},St.coordArrayType.get=function(){return new Array(0).fill(null)},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},xt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(xt.indexOf(r,e)<0)return r}return null},xt.scroll=function(t,e){var n=xt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);V.arraycopy(t,n,r,0,t.length-n),V.arraycopy(t,0,r,t.length-n,n),V.arraycopy(r,0,t,0,t.length)},xt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var o=0;o<r.length;o++)if(0!==A.compare(r[o],i[o]))return!1;return!0}},xt.intersection=function(t,e){for(var n=new It,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},xt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},xt.removeRepeatedPoints=function(t){return xt.hasRepeatedPoints(t)?new It(t,!1).toCoordinateArray():t},xt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},xt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,A=0;A<t.length;A++)null!==t[A]&&(r[i++]=t[A]);return r},xt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new C(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],A=arguments[2],o=arguments[3],s=arguments[4],a=0;a<s;a++)A[o+a]=new C(r[i+a])},xt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},xt.envelope=function(t){for(var e=new j,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},xt.toCoordinateArray=function(t){return t.toArray(xt.coordArrayType)},xt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},xt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},xt.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(0!==r)return r}return 1},xt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},xt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},xt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var A=0,o=e;o<=n;o++)i[A++]=t[o];return i},Object.defineProperties(xt,St);var Nt=function(){};Nt.prototype.compare=function(t,e){return xt.compare(t,e)},Nt.prototype.interfaces_=function(){return[E]},Nt.prototype.getClass=function(){return Nt};var Dt=function(){};Dt.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(0===n.length)return 0;var i=xt.compare(n,r);return xt.isEqualReversed(n,r)?0:i},Dt.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(0===n.length)return 0;for(var i=xt.increasingDirection(n),A=xt.increasingDirection(r),o=i>0?0:n.length-1,s=A>0?0:n.length-1,a=0;a<n.length;a++){var u=n[o].compareTo(r[s]);if(0!==u)return u;o+=i,s+=A}return 0},Dt.prototype.interfaces_=function(){return[E]},Dt.prototype.getClass=function(){return Dt};var Lt=function(){};Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt);(i.prototype=new Error).name="OperationNotSupported",(A.prototype=new vt).contains=function(){};var Mt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Ot(this)},e}(A),Ot=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(bt),Pt=0;(l.prototype=new Tt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},l.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Pt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var A=i.value;return i.value=e,A}i=i.right}}while(null!==i);var o={key:t,left:null,right:null,value:e,parent:n,color:Pt,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},l.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===u(s(s(t)))){var e=c(s(s(t)));1===o(e)?(a(s(t),Pt),a(e,Pt),a(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),a(s(t),Pt),a(s(s(t)),1),this.rotateRight(s(s(t))))}else{var n=u(s(s(t)));1===o(n)?(a(s(t),Pt),a(n,Pt),a(s(s(t)),1),t=s(s(t))):(t===u(s(t))&&(t=s(t),this.rotateRight(t)),a(s(t),Pt),a(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Pt},l.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=l.successor(e));)t.add(e.value);return t},l.prototype.entrySet=function(){var t=new Mt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=l.successor(e));)t.add(e);return t},l.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},l.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},l.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},l.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},l.prototype.size=function(){return this.size_};var Rt=function(){};Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},f.prototype=new A,(h.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},h.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},h.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},h.prototype.remove=function(t){throw new i},h.prototype.size=function(){return this.array_.length},h.prototype.isEmpty=function(){return 0===this.array_.length},h.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},h.prototype.iterator=function(){return new kt(this)};var kt=function(t){this.treeSet_=t,this.position_=0};kt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},kt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},kt.prototype.remove=function(){throw new i};var Bt=function(){};Bt.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var A=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<A.length;t++)i.push(A[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),A=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<A.length;t++)i.push(A[t])},Bt.asList=function(t){for(var e=new Et,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Ft=function(){},Gt={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}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.toDimensionSymbol=function(t){switch(t){case Ft.FALSE:return Ft.SYM_FALSE;case Ft.TRUE:return Ft.SYM_TRUE;case Ft.DONTCARE:return Ft.SYM_DONTCARE;case Ft.P:return Ft.SYM_P;case Ft.L:return Ft.SYM_L;case Ft.A:return Ft.SYM_A}throw new _("Unknown dimension value: "+t)},Ft.toDimensionValue=function(t){switch(R.toUpperCase(t)){case Ft.SYM_FALSE:return Ft.FALSE;case Ft.SYM_TRUE:return Ft.TRUE;case Ft.SYM_DONTCARE:return Ft.DONTCARE;case Ft.SYM_P:return Ft.P;case Ft.SYM_L:return Ft.L;case Ft.SYM_A:return Ft.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(Ft,Gt);var Ut=function(){};Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Qt=function(){};Qt.prototype.filter=function(t,e){},Qt.prototype.isDone=function(){},Qt.prototype.isGeometryChanged=function(){},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var zt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new j,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Bt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new h(Bt.asList(this._geometries)),n=new h(Bt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],A=this.getNumGeometries(),o=i.getNumGeometries(),s=0;s<A&&s<o;){var a=this.getGeometryN(s),u=i.getGeometryN(s),c=a.compareToSameClass(u,r);if(0!==c)return c;s++}return s<A?1:s<o?-1:0}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Ut)){var i=arguments[0];i.filter(this);for(var A=0;A<this._geometries.length;A++)this._geometries[A].apply(i)}else if(L(arguments[0],ut)){var o=arguments[0];o.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(o)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),qt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Vt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Rt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(zt),Vt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=pt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Vt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Vt.prototype.getBoundary=function(){return this._geom instanceof Wt?this.boundaryLineString(this._geom):this._geom instanceof qt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Vt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Vt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Vt.prototype.computeBoundaryCoordinates=function(t){var e=new Et;this._endpointMap=new l;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var A=i.next(),o=A.getValue().count;this._bnRule.isInBoundary(o)&&e.add(A.getKey())}return xt.toCoordinateArray(e)},Vt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yt,this._endpointMap.put(t,e)),e.count++},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.getBoundary=function(){return 1===arguments.length?new Vt(arguments[0]).getBoundary():2===arguments.length?new Vt(arguments[0],arguments[1]).getBoundary():void 0};var Yt=function(){this.count=null};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var jt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},jt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){};return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],A="",o=new function(){}(new function(){}(jt.getStackTrace(r))),s=0;s<i;s++)try{A+=o.readLine()+jt.NEWLINE}catch(t){if(!(t instanceof p))throw t;et.shouldNeverReachHere()}return A}},jt.split=function(t,e){for(var n=e.length,r=new Et,i=""+t,A=i.indexOf(e);A>=0;){var o=i.substring(0,A);r.add(o),A=(i=i.substring(A+n)).indexOf(e)}i.length>0&&r.add(i);for(var s=new Array(r.size()).fill(null),a=0;a<s.length;a++)s[a]=r.get(a);return s},jt.toString=function(){if(1===arguments.length){var t=arguments[0];return jt.SIMPLE_ORDINATE_FORMAT.format(t)}},jt.spaces=function(t){return jt.chars(" ",t)},Ht.NEWLINE.get=function(){return V.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}},Object.defineProperties(jt,Ht);var Xt=function(){};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),A=0;A<i;A++)n.setOrdinate(r,A,t.getOrdinate(e,A))},Xt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,U.X)===t.getOrdinate(e-1,U.X)&&t.getOrdinate(0,U.Y)===t.getOrdinate(e-1,U.Y)},Xt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var A=0;A<r;A++){var o=t.getOrdinate(i,A),s=e.getOrdinate(i,A);if(!(t.getOrdinate(i,A)===e.getOrdinate(i,A)||m.isNaN(o)&&m.isNaN(s)))return!1}return!0},Xt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Xt.copy(e,0,r,0,i),i>0)for(var A=i;A<n;A++)Xt.copy(e,i-1,r,A,1);return r},Xt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Xt.swap(t,r,e-r)},Xt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Xt.copy=function(t,e,n,r,i){for(var A=0;A<i;A++)Xt.copyCoord(t,e+A,n,r+A)},Xt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var A=0;A<n;A++)A>0&&r.append(","),r.append(jt.toString(t.getOrdinate(i,A)))}return r.append(")"),r.toString()}},Xt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Xt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(n-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(n-1,U.Y)?e:Xt.createClosedRing(t,e,n+1)},Xt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Xt.copy(e,0,r,0,i);for(var A=i;A<n;A++)Xt.copy(e,0,r,A,1);return r};var Wt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new j:this._points.expandEnvelope(new j)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Xt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Vt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Rt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),$t=function(){};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Kt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new j;var t=new j;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(L(arguments[0],ht)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],Qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),Jt=function(){};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Zt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var A=this._holes[i].getCoordinates(),o=0;o<A.length;o++)t[++e]=A[o];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(st.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(st.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var A=t.getX(0),o=t.getY(0),s=1;s<=4;s++){var a=t.getX(s),u=t.getY(s);if(a!==A==(u!==o))return!1;A=a,o=u}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,A=r._shell;if(!i.equalsExact(A,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var o=0;o<this._holes.length;o++)if(!this._holes[o].equalsExact(r._holes[o],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Bt.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);V.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=xt.minCoordinate(e.getCoordinates());xt.scroll(r,i),V.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],st.isCCW(e.getCoordinates())===n&&xt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],A=this._shell,o=i._shell,s=A.compareToSameClass(o,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=i.getNumInteriorRing(),c=0;c<a&&c<u;){var l=this.getInteriorRingN(c),f=i.getInteriorRingN(c),h=l.compareToSameClass(f,r);if(0!==h)return h;c++}return c<a?1:c<u?-1:0}},e.prototype.apply=function(t){if(L(t,ht)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,Qt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Ut))t.filter(this);else if(L(t,ut)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(zt),ee=function(t){function e(e,n){e instanceof C&&n instanceof ye&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Wt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new Et,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof zt?this.editGeometryCollection(t,e):t instanceof Zt?this.editPolygon(t,e):t instanceof Kt||t instanceof Wt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Et,i=0;i<n.getNumGeometries();i++){var A=this.edit(n.getGeometryN(i),e);null===A||A.isEmpty()||r.add(A)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===qt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new Et,A=0;A<n.getNumInteriorRing();A++){var o=this.edit(n.getInteriorRingN(A),e);null===o||o.isEmpty()||i.add(o)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return Ae},ie.CoordinateOperation.get=function(){return oe},ie.CoordinateSequenceOperation.get=function(){return se},Object.defineProperties(re,ie);var Ae=function(){};Ae.prototype.edit=function(t,e){return t},Ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},Ae.prototype.getClass=function(){return Ae};var oe=function(){};oe.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Wt?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new C}else if(L(arguments[0],U)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],A=arguments[1];this._coordinates=i,this._dimension=A,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=new Array(o).fill(null),this._dimension=s;for(var a=0;a<o;a++)this._coordinates[a]=new C}},ue={serialVersionUID:{configurable:!0}};ae.prototype.setOrdinate=function(t,e,n){switch(e){case U.X:this._coordinates[t].x=n;break;case U.Y:this._coordinates[t].y=n;break;case U.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ae.prototype.size=function(){return this._coordinates.length},ae.prototype.getOrdinate=function(t,e){switch(e){case U.X:return this._coordinates[t].x;case U.Y:return this._coordinates[t].y;case U.Z:return this._coordinates[t].z}return m.NaN},ae.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){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}},ae.prototype.getCoordinateCopy=function(t){return new C(this._coordinates[t])},ae.prototype.getDimension=function(){return this._dimension},ae.prototype.getX=function(t){return this._coordinates[t].x},ae.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ae(t,this._dimension)},ae.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ae.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ae(t,this._dimension)},ae.prototype.toString=function(){if(this._coordinates.length>0){var t=new O(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ae.prototype.getY=function(t){return this._coordinates[t].y},ae.prototype.toCoordinateArray=function(){return this._coordinates},ae.prototype.interfaces_=function(){return[U,e]},ae.prototype.getClass=function(){return ae},ue.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ae,ue);var ce=function(){},le={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ae(arguments[0]);if(L(arguments[0],U))return new ae(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ae(t):new ae(t,e)}},ce.prototype.interfaces_=function(){return[S,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},le.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},le.instanceObject.get=function(){return new ce},Object.defineProperties(ce,le);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Mt;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),he=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},pe={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};he.prototype.equals=function(t){if(!(t instanceof he))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},he.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new P(n).compareTo(new P(r))},he.prototype.getScale=function(){return this._scale},he.prototype.isFloating=function(){return this._modelType===he.FLOATING||this._modelType===he.FLOATING_SINGLE},he.prototype.getType=function(){return this._modelType},he.prototype.toString=function(){var t="UNKNOWN";return this._modelType===he.FLOATING?t="Floating":this._modelType===he.FLOATING_SINGLE?t="Floating-Single":this._modelType===he.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},he.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===he.FLOATING_SINGLE?t:this._modelType===he.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof C){var e=arguments[0];if(this._modelType===he.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},he.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===he.FLOATING?t=16:this._modelType===he.FLOATING_SINGLE?t=6:this._modelType===he.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},he.prototype.setScale=function(t){this._scale=Math.abs(t)},he.prototype.interfaces_=function(){return[e,b]},he.prototype.getClass=function(){return he},he.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},pe.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},pe.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(he,pe);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ge={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ge.serialVersionUID.get=function(){return-552860263173159e4},ge.nameToTypeMap.get=function(){return new fe},Object.defineProperties(de,ge),he.Type=de,he.FIXED=new de("FIXED"),he.FLOATING=new de("FLOATING"),he.FLOATING_SINGLE=new de("FLOATING SINGLE");var ye=function t(){this._precisionModel=new he,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],S)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof he&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new C(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new C(t.getMinX(),t.getMinY()),new C(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new C(t.getMinX(),t.getMinY()),new C(t.getMinX(),t.getMaxY()),new C(t.getMaxX(),t.getMaxY()),new C(t.getMaxX(),t.getMinY()),new C(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new Wt(this.getCoordinateSequenceFactory().create(t),this):L(t,U)?new Wt(t,this):void 0:new Wt(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){return 0===arguments.length?new qt(null,this):1===arguments.length?new qt(arguments[0],this):void 0},ye.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var A=i.next(),o=A.getClass();null===e&&(e=o),o!==e&&(n=!0),A.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ye.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Zt)return this.createMultiPolygon(ye.toPolygonArray(t));if(s instanceof Wt)return this.createMultiLineString(ye.toLineStringArray(t));if(s instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],U))return new Kt(arguments[0],this)}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new Zt(null,null,this);if(1===arguments.length){if(L(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Zt(arguments[0],arguments[1],this)},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},ye.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U))return new ee(arguments[0],this)}},ye.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Xt.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ye.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ye.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ye,_e);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ve=function(t){this.geometryFactory=t||new ye};ve.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!be[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?be[n].apply(this,[e.coordinates]):"GeometryCollection"===n?be[n].apply(this,[e.geometries]):be[n].apply(this,[e])},ve.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var be={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!be[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=be.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new C(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new C(t[0],t[1]),new C(t[2],t[1]),new C(t[2],t[3]),new C(t[0],t[3]),new C(t[0],t[1])])},Point:function(t){var e=new C(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=be.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=be.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var A=t[i],o=be.coordinates.apply(this,[A]),s=this.geometryFactory.createLinearRing(o);r.push(s)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(be.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(we.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],A=we.LineString.apply(this,[i]);e.push(A.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(we[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ee=function(t){this.geometryFactory=t||new ye,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ve(this.geometryFactory)};Ee.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===he.FIXED&&this.reducePrecision(e),e},Ee.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ce=function(){this.parser=new ve(this.geometryFactory)};Ce.prototype.write=function(t){return this.parser.write(t)};var Ie=function(){},xe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.opposite=function(t){return t===Ie.LEFT?Ie.RIGHT:t===Ie.RIGHT?Ie.LEFT:t},xe.ON.get=function(){return 0},xe.LEFT.get=function(){return 1},xe.RIGHT.get=function(){return 2},Object.defineProperties(Ie,xe),(d.prototype=new Error).name="EmptyStackException",(g.prototype=new wt).add=function(t){return this.array_.push(t),!0},g.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},g.prototype.push=function(t){return this.array_.push(t),t},g.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},g.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},g.prototype.empty=function(){return 0===this.array_.length},g.prototype.isEmpty=function(){return this.empty()},g.prototype.search=function(t){return this.array_.indexOf(t)},g.prototype.size=function(){return this.array_.length},g.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Se=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Se.prototype.getCoordinate=function(){return this._minCoord},Se.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},Se.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.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=st.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===st.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Se.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ie.LEFT;return n[e].y<n[e+1].y&&(r=Ie.RIGHT),r},Se.prototype.getEdge=function(){return this._orientedDe},Se.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Se.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Se.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ie.LEFT&&(this._orientedDe=this._minDe.getSym())},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se};var Ne=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new C(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Z),De=function(){this.array_=[]};De.prototype.addLast=function(t){this.array_.push(t)},De.prototype.removeFirst=function(){return this.array_.shift()},De.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Se};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Ne("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var A=i.next();A.setVisited(!0),this.copySymDepths(A)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ie.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ie.RIGHT)>=1&&e.getDepth(Ie.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new Mt,n=new De,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var A=i.getEdges().iterator();A.hasNext();){var o=A.next().getSym();if(!o.isVisited()){var s=o.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new j,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Le.prototype.addReachable=function(t){var e=new g;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ie.LEFT,t.getDepth(Ie.RIGHT)),e.setDepth(Ie.RIGHT,t.getDepth(Ie.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[b]},Le.prototype.getClass=function(){return Le};var Te=function t(){if(this.location=null,1===arguments.length){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[Ie.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[Ie.ON]=A,this.location[Ie.LEFT]=o,this.location[Ie.RIGHT]=s}};Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==N.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===N.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ie.ON]=this.location[Ie.ON],e[Ie.LEFT]=N.NONE,e[Ie.RIGHT]=N.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===N.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ie.LEFT];this.location[Ie.LEFT]=this.location[Ie.RIGHT],this.location[Ie.RIGHT]=t},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ie.LEFT])),t.append(N.toLocationSymbol(this.location[Ie.ON])),this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ie.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ie.ON]=t,this.location[Ie.LEFT]=e,this.location[Ie.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:N.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===N.NONE)return!0;return!1},Te.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ie.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(N.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Me=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Te(N.NONE),this.elt[1]=new Te(N.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Te(A,o,s),this.elt[1]=new Te(A,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new Te(N.NONE,N.NONE,N.NONE),this.elt[1]=new Te(N.NONE,N.NONE,N.NONE),this.elt[a].setLocations(u,c,l)}};Me.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Me.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Me.prototype.isNull=function(t){return this.elt[t].isNull()},Me.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Me.prototype.isLine=function(t){return this.elt[t].isLine()},Me.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Me.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Me.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ie.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Me.prototype.toString=function(){var t=new O;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Me.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Me.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Me.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ie.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Me.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Me.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Me.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toLineLabel=function(t){for(var e=new Me(N.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Oe=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Et,this._pts=new Et,this._label=new Me(N.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Et,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Oe.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=st.isCCW(this._ring.getCoordinates())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ne("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ne("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Oe.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var A=i;A<r.length;A++)this._pts.add(r[A])}else{var o=r.length-2;n&&(o=r.length-1);for(var s=o;s>=0;s--)this._pts.add(r[s])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Ie.RIGHT);if(n===N.NONE)return null;if(this._label.getLocation(e)===N.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var Pe=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new Et,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Pe(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),ke=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};ke.prototype.setVisited=function(t){this._isVisited=t},ke.prototype.setInResult=function(t){this._isInResult=t},ke.prototype.isCovered=function(){return this._isCovered},ke.prototype.isCoveredSet=function(){return this._isCoveredSet},ke.prototype.setLabel=function(t){this._label=t},ke.prototype.getLabel=function(){return this._label},ke.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ke.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ke.prototype.isInResult=function(){return this._isInResult},ke.prototype.isVisited=function(){return this._isVisited},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var Be=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Me(0,N.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=N.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==N.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Me(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Me)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===N.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=N.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case N.BOUNDARY:n=N.INTERIOR;break;case N.INTERIOR:default:n=N.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),Fe=function(){this.nodeMap=new l,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof C){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Be){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new Et,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===N.BOUNDARY&&e.add(r)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Ge=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Ge,Ue);var Qe=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,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3];this._edge=i,this.init(A,o),this._label=s}};Qe.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:st.computeOrientation(t._p0,t._p1,this._p1)},Qe.prototype.getDy=function(){return this._dy},Qe.prototype.getCoordinate=function(){return this._p0},Qe.prototype.setNode=function(t){this._node=t},Qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Qe.prototype.getDirectedCoordinate=function(){return this._p1},Qe.prototype.getDx=function(){return this._dx},Qe.prototype.getLabel=function(){return this._label},Qe.prototype.getEdge=function(){return this._edge},Qe.prototype.getQuadrant=function(){return this._quadrant},Qe.prototype.getNode=function(){return this._node},Qe.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Qe.prototype.computeLabel=function(t){},Qe.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=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Qe.prototype.interfaces_=function(){return[b]},Qe.prototype.getClass=function(){return Qe};var ze=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Me(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Ne("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ie.LEFT)===N.INTERIOR&&this._label.getLocation(e,Ie.RIGHT)===N.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Ie.LEFT]+"/"+this._depth[Ie.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,N.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,N.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Ie.LEFT&&(r=-1);var i=Ie.opposite(t),A=e+n*r;this.setDepth(t,e),this.setDepth(i,A)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===N.EXTERIOR&&e===N.INTERIOR?1:t===N.INTERIOR&&e===N.EXTERIOR?-1:0},e}(Qe),qe=function(){};qe.prototype.createNode=function(t){return new Be(t,null)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var Ve=function(){if(this._edges=new Et,this._nodes=null,this._edgeEndList=new Et,0===arguments.length)this._nodes=new Fe(new qe);else if(1===arguments.length){var t=arguments[0];this._nodes=new Fe(t)}};Ve.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Ve.prototype.find=function(t){return this._nodes.find(t)},Ve.prototype.addNode=function(){if(arguments[0]instanceof Be){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof C){var e=arguments[0];return this._nodes.addNode(e)}},Ve.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ve.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ve.prototype.debugPrintln=function(t){V.out.println(t)},Ve.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===N.BOUNDARY},Ve.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ve.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&st.computeOrientation(t,e,r)===st.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},Ve.prototype.getEdgeEnds=function(){return this._edgeEndList},Ve.prototype.debugPrint=function(t){V.out.print(t)},Ve.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ve.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Ve.prototype.insertEdge=function(t){this._edges.add(t)},Ve.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ve.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new ze(n,!0),i=new ze(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ve.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ve.prototype.getNodes=function(){return this._nodes.values()},Ve.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Ye=function(){this._geometryFactory=null,this._shellList=new Et;var t=arguments[0];this._geometryFactory=t};Ye.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Ye.prototype.computePolygons=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Ye.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Ne("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Et,i=t.iterator();i.hasNext();){var A=i.next();if(A.getMaxNodeDegree()>2){A.linkDirectedEdgesForMinimalEdgeRings();var o=A.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),e.add(s)):n.addAll(o)}else r.add(A)}return r},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Re(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),A=null,o=null,s=e.iterator();s.hasNext();){var a=s.next(),u=a.getLinearRing(),c=u.getEnvelopeInternal();null!==A&&(o=A.getLinearRing().getEnvelopeInternal());var l=!1;c.contains(r)&&st.isPointInRing(i,u.getCoordinates())&&(l=!0),l&&(null===A||o.contains(c))&&(A=a)}return A},Ye.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Ve.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Et,A=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(A,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var je=function(){};je.prototype.getBounds=function(){},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[je,e]},He.prototype.getClass=function(){return He};var Xe=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};Xe.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},Xe.prototype.size=function(){return this._size},Xe.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Xe.prototype.clear=function(){this._size=0,this._items.clear()},Xe.prototype.isEmpty=function(){return 0===this._size},Xe.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var We=function(){};We.prototype.visitItem=function(t){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var $e=function(){};$e.prototype.insert=function(t,e){},$e.prototype.remove=function(t,e){},$e.prototype.query=function(){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ke=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[je,e]},Ke.prototype.getClass=function(){return Ke},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Je);var Ze=function(){};Ze.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Ze.min=function(t){return Ze.sort(t),t.get(0)},Ze.sort=function(t,e){var n=t.toArray();e?Bt.sort(n,e):Bt.sort(n);for(var r=t.iterator(),i=0,A=n.length;i<A;i++)r.next(),r.set(n[i])},Ze.singletonList=function(t){var e=new Et;return e.add(t),e};var tn=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()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.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 _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var A=i.next(),o=new tn(A,e,this._itemDistance);o.getDistance()<r&&n.add(o)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[b]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Et,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof He&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],n=new Et,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ke){var A=this.itemsTree(i);null!==A&&n.add(A)}else i instanceof He?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var A=r.getChildBoundables().iterator();A.hasNext();){var o=A.next();o instanceof Ke?this.boundablesAtLevel(n,o,i):(et.isTrue(o instanceof He),-1===n&&i.add(o))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(L(arguments[2],We)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var i=arguments[0],A=arguments[2],o=arguments[1].getChildBoundables(),s=0;s<o.size();s++){var a=o.get(s);this.getIntersectsOp().intersects(a.getBounds(),i)&&(a instanceof Ke?this.query(i,a,A):a instanceof He?A.visitItem(a.getItem()):et.shouldNeverReachHere())}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var u=arguments[0],c=arguments[2],l=arguments[1].getChildBoundables(),f=0;f<l.size();f++){var h=l.get(f);this.getIntersectsOp().intersects(h.getBounds(),u)&&(h instanceof Ke?this.query(u,h,c):h instanceof He?c.add(h.getItem()):et.shouldNeverReachHere())}},en.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},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],A=this.removeItem(r,i);if(A)return!0;for(var o=null,s=r.getChildBoundables().iterator();s.hasNext();){var a=s.next();if(this.getIntersectsOp().intersects(a.getBounds(),n)&&a instanceof Ke&&(A=this.remove(n,a,i))){o=a;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),A}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Et;n.add(this.createNode(e));var r=new Et(t);Ze.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var A=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(A)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},An=function(){};An.prototype.distance=function(t,e){},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var on=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new Et,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new sn(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),A=0;A<e;A++){r[A]=new Et;for(var o=0;i.hasNext()&&o<n;){var s=i.next();r[A].add(s),o++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(L(arguments[2],We)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var i=arguments[0],A=arguments[1],o=arguments[2];t.prototype.query.call(this,i,A,o)}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new Et(t);Ze.sort(i,n.xComparator);var A=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(A,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(L(arguments[0],An)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&L(arguments[1],An)){var i=arguments[0],A=arguments[1],o=new tn(this.getRoot(),i.getRoot(),A);return this.nearestNeighbour(o)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,c=new Xe;for(c.add(s);!c.isEmpty()&&a>0;){var l=c.poll(),f=l.getDistance();if(f>=a)break;l.isLeaves()?(a=f,u=l):l.expandToQueue(c,a)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var h=arguments[2],p=new He(arguments[0],arguments[1]),d=new tn(this.getRoot(),p,h);return this.nearestNeighbour(d)[0]}},n.prototype.interfaces_=function(){return[$e,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return sn},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),sn=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new j(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),an=function(){};an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},an.relativeSign=function(t,e){return t<e?-1:t>e?1:0},an.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=an.relativeSign(e.x,n.x),i=an.relativeSign(e.y,n.y);switch(t){case 0:return an.compareValue(r,i);case 1:return an.compareValue(i,r);case 2:return an.compareValue(i,-r);case 3:return an.compareValue(-r,i);case 4:return an.compareValue(-r,-i);case 5:return an.compareValue(-i,-r);case 6:return an.compareValue(-i,r);case 7:return an.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},an.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var un=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 C(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};un.prototype.getCoordinate=function(){return this.coord},un.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},un.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:an.compare(this._segmentOctant,this.coord,e.coord)},un.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},un.prototype.isInterior=function(){return this._isInterior},un.prototype.interfaces_=function(){return[b]},un.prototype.getClass=function(){return un};var cn=function(){this._nodeMap=new l,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new It;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new P(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new C(t.coord),!1);for(var A=t.segmentIndex+1;A<=e.segmentIndex;A++)n.add(this._edge.getCoordinate(A));i&&n.add(new C(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new P(e[0])),r=i}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var A=new Array(n).fill(null),o=0;A[o++]=new C(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)A[o++]=this._edge.getCoordinate(s);return i&&(A[o]=new C(e.coord)),new pn(A,this._edge.getData())},cn.prototype.add=function(t,e){var n=new un(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Z("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Z("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("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}if(arguments[0]instanceof C&&arguments[1]instanceof C){var i=arguments[0],A=arguments[1],o=A.x-i.x,s=A.y-i.y;if(0===o&&0===s)throw new _("Cannot compute the octant for two identical points "+i);return ln.octant(o,s)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var hn=function(){};hn.prototype.addIntersection=function(t,e){},hn.prototype.interfaces_=function(){return[fn]},hn.prototype.getClass=function(){return hn};var pn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};pn.prototype.getCoordinates=function(){return this._pts},pn.prototype.size=function(){return this._pts.length},pn.prototype.getCoordinate=function(t){return this._pts[t]},pn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},pn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},pn.prototype.setData=function(t){this._data=t},pn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ln.octant(t,e)},pn.prototype.getData=function(){return this._data},pn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new C(arguments[0].getIntersection(r));this.addIntersection(i,n)}},pn.prototype.toString=function(){return J.toLineString(new ae(this._pts))},pn.prototype.getNodeList=function(){return this._nodeList},pn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},pn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},pn.prototype.interfaces_=function(){return[hn]},pn.prototype.getClass=function(){return pn},pn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return pn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new C,this.p1=new C;else if(1===arguments.length){var t=arguments[0];this.p0=new C(t.p0),this.p1=new C(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new C(e,n),this.p1=new C(r,i)}},gn={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=st.orientationIndex(this.p0,this.p1,t.p0),n=st.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof C){var r=arguments[0];return st.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof C){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new C(t);var e=this.projectionFactor(t),n=new C;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}if(arguments[0]instanceof dn){var r=arguments[0],i=this.projectionFactor(r.p0),A=this.projectionFactor(r.p1);if(i>=1&&A>=1)return null;if(i<=0&&A<=0)return null;var o=this.project(r.p0);i<0&&(o=this.p0),i>1&&(o=this.p1);var s=this.project(r.p1);return A<0&&(s=this.p0),A>1&&(s=this.p1),new dn(o,s)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.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;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,i=null,A=this.closestPoint(t.p0);r=A.distance(t.p0),n[0]=A,n[1]=t.p0;var o=this.closestPoint(t.p1);(i=o.distance(t.p1))<r&&(r=i,n[0]=o,n[1]=t.p1);var s=t.closestPoint(this.p0);(i=s.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=s);var a=t.closestPoint(this.p1);return(i=a.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=a),n},dn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.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)},dn.prototype.lineIntersection=function(t){try{return Y.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof q))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.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),i=this.p1.x-this.p0.x,A=this.p1.y-this.p0.y,o=Math.sqrt(i*i+A*A),s=0,a=0;if(0!==e){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*i/o,a=e*A/o}return new C(n-a,r+s)},dn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){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}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof C){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new C;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},dn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[b,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new C((t.x+e.x)/2,(t.y+e.y)/2)},gn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,gn);var yn=function(){this.tempEnv1=new j,this.tempEnv2=new j,this._overlapSeg1=new dn,this._overlapSeg2=new dn};yn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var _n=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};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],A=this._pts[n];if(r.tempEnv1.init(i,A),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var o=Math.trunc((e+n)/2);e<o&&this.computeSelect(t,e,o,r),o<n&&this.computeSelect(t,o,n,r)},_n.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new j(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,i,A){var o=this._pts[t],s=this._pts[e],a=n._pts[r],u=n._pts[i];if(e-t==1&&i-r==1)return A.overlap(this,t,n,r),null;if(A.tempEnv1.init(o,s),A.tempEnv2.init(a,u),!A.tempEnv1.intersects(A.tempEnv2))return null;var c=Math.trunc((t+e)/2),l=Math.trunc((r+i)/2);t<c&&(r<l&&this.computeOverlapsInternal(t,c,n,r,l,A),l<i&&this.computeOverlapsInternal(t,c,n,l,i,A)),c<e&&(r<l&&this.computeOverlapsInternal(c,e,n,r,l,A),l<i&&this.computeOverlapsInternal(c,e,n,l,i,A))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new P(e));do{var r=mn.findChainEnd(t,e);n.add(new P(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.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=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new Et,i=mn.getChainStartIndices(e),A=0;A<i.length-1;A++){var o=new _n(e,i[A],i[A+1],n);r.add(o)}return r}},mn.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 vn=function(){};vn.prototype.computeNodes=function(t){},vn.prototype.getNodedSubstrings=function(){},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var bn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};bn.prototype.setSegmentIntersector=function(t){this._segInt=t},bn.prototype.interfaces_=function(){return[vn]},bn.prototype.getClass=function(){return bn};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Et,this._index=new on,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new En(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return En},Object.defineProperties(e,n),e}(bn),En=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),A=n.getContext();this._si.processIntersections(i,e,A,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yn),Cn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(A),this.setJoinStyle(o),this.setMitreLimit(s)}},In={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}};Cn.prototype.getEndCapStyle=function(){return this._endCapStyle},Cn.prototype.isSingleSided=function(){return this._isSingleSided},Cn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Cn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Cn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Cn.JOIN_ROUND&&(this._quadrantSegments=Cn.DEFAULT_QUADRANT_SEGMENTS)},Cn.prototype.getJoinStyle=function(){return this._joinStyle},Cn.prototype.setJoinStyle=function(t){this._joinStyle=t},Cn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Cn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Cn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Cn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Cn.prototype.getMitreLimit=function(){return this._mitreLimit},Cn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Cn.prototype.setSingleSided=function(t){this._isSingleSided=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},In.CAP_ROUND.get=function(){return 1},In.CAP_FLAT.get=function(){return 2},In.CAP_SQUARE.get=function(){return 3},In.JOIN_ROUND.get=function(){return 1},In.JOIN_MITRE.get=function(){return 2},In.JOIN_BEVEL.get=function(){return 3},In.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},In.DEFAULT_MITRE_LIMIT.get=function(){return 5},In.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Cn,In);var xn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Sn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};xn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],A=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(i,A,o)&&!!this.isShallow(i,A,o,r)&&this.isShallowSampled(i,A,t,n,r)},xn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=xn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},xn.prototype.isShallowConcavity=function(t,e,n,r){return st.computeOrientation(t,e,n)===this._angleOrientation&&st.distancePointLine(e,t,n)<r},xn.prototype.isShallowSampled=function(t,e,n,r,i){var A=Math.trunc((r-n)/xn.NUM_PTS_TO_CHECK);A<=0&&(A=1);for(var o=n;o<r;o+=A)if(!this.isShallow(t,e,this._inputLine[o],i))return!1;return!0},xn.prototype.isConcave=function(t,e,n){return st.computeOrientation(t,e,n)===this._angleOrientation},xn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=st.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},xn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===xn.DELETE;)e++;return e},xn.prototype.isShallow=function(t,e,n,r){return st.distancePointLine(e,t,n)<r},xn.prototype.collapseLine=function(){for(var t=new It,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==xn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.simplify=function(t,e){return new xn(t).simplify(e)},Sn.INIT.get=function(){return 0},Sn.DELETE.get=function(){return 1},Sn.KEEP.get=function(){return 1},Sn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(xn,Sn);var Nn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Et},Dn={COORDINATE_ARRAY_TYPE:{configurable:!0}};Nn.prototype.getCoordinates=function(){return this._ptList.toArray(Nn.COORDINATE_ARRAY_TYPE)},Nn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Nn.prototype.addPt=function(t){var e=new C(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Nn.prototype.revere=function(){},Nn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Nn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Nn.prototype.toString=function(){return(new ye).createLineString(this.getCoordinates()).toString()},Nn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new C(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Nn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Dn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Nn,Dn);var Ln=function(){},Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ln.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Math.abs(i-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Ln.diff(r,i)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n)-r;return i<=-Math.PI?i+Ln.PI_TIMES_2:i>Math.PI?i-Ln.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return st.CLOCKWISE},Tn.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Ln,Tn);var Mn=function t(){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 dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Cn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},On={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}};Mn.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=st.computeOrientation(this._s0,this._s1,this._s2),r=n===st.CLOCKWISE&&this._side===Ie.LEFT||n===st.COUNTERCLOCKWISE&&this._side===Ie.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Mn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Ie.LEFT,this._distance,r);var i=new dn;this.computeOffsetSegment(n,Ie.RIGHT,this._distance,i);var A=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,A);switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Cn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Cn.CAP_SQUARE:var a=new C;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new C(r.p1.x+a.x,r.p1.y+a.y),c=new C(i.p1.x+a.x,i.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(c)}},Mn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Mn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,A=null;try{A=Y.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:A.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof q))throw t;A=new C(0,0),i=!1}i?this._segList.addPt(A):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Mn.prototype.addFilletCorner=function(t,e,n,r,i){var A=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,A),a=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,a);r===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,i),this._segList.addPt(n)},Mn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Mn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Cn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Cn.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))},Mn.prototype.createSquare=function(t){this._segList.addPt(new C(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new C(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Mn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Mn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Mn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Mn.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)},Mn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,A=Ln.angle(i,this._seg0.p0),o=Ln.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,s=Ln.normalize(A+o),a=Ln.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(o)),l=i.x+u*Math.cos(a),f=i.y+u*Math.sin(a),h=new C(l,f),p=new dn(i,h),d=p.pointAlongOffset(1,c),g=p.pointAlongOffset(1,-c);this._side===Ie.LEFT?(this._segList.addPt(d),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(d))},Mn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ie.LEFT?1:-1,A=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,s=Math.sqrt(A*A+o*o),a=i*n*A/s,u=i*n*o/s;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+a,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+a},Mn.prototype.addFilletArc=function(t,e,n,r,i){var A=r===st.CLOCKWISE?-1:1,o=Math.abs(e-n),s=Math.trunc(o/this._filletAngleQuantum+.5);if(s<1)return null;for(var a=o/s,u=0,c=new C;u<o;){var l=e+A*u;c.x=t.x+i*Math.cos(l),c.y=t.y+i*Math.sin(l),this._segList.addPt(c),u+=a}},Mn.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*Mn.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 C((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 C((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)}},Mn.prototype.createCircle=function(t){var e=new C(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Mn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Mn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Nn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Mn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Cn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Cn.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,st.CLOCKWISE,this._distance))},Mn.prototype.closeRing=function(){this._segList.closeRing()},Mn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Mn,On);var Pn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Pn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var A=i.getCoordinates();return n&&xt.reverse(A),A},Pn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=xn.simplify(t,-r),A=i.length-1;n.initSideSegments(i[A],i[A-1],Ie.LEFT),n.addFirstSegment();for(var o=A-2;o>=0;o--)n.addNextSegment(i[o],!0)}else{n.addSegments(t,!1);var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ie.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},Pn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ie.RIGHT&&(r=-r);var i=xn.simplify(t,r),A=i.length-1;n.initSideSegments(i[A-1],i[0],e);for(var o=1;o<=A;o++){var s=1!==o;n.addNextSegment(i[o],s)}n.closeRing()},Pn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=xn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ie.LEFT);for(var A=2;A<=i;A++)e.addNextSegment(r[A],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var o=xn.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],Ie.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},Pn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:e.createCircle(t);break;case Cn.CAP_SQUARE:e.createSquare(t)}},Pn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)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 i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Pn.prototype.getBufferParameters=function(){return this._bufParams},Pn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Pn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Pn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Pn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=xn.simplify(t,-r),A=i.length-1;n.initSideSegments(i[A],i[A-1],Ie.LEFT),n.addFirstSegment();for(var o=A-2;o>=0;o--)n.addNextSegment(i[o],!0)}else{var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ie.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},Pn.prototype.getSegGen=function(t){return new Mn(this._precisionModel,this._bufParams,t)},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new C(t[n]);return e};var Rn=function(){this._subgraphs=null,this._seg=new dn,this._cga=new st;var t=arguments[0];this._subgraphs=t},kn={DepthSegment:{configurable:!0}};Rn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new Et,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof C&&arguments[1]instanceof ze){for(var A=arguments[0],o=arguments[1],s=arguments[2],a=o.getEdge().getCoordinates(),u=0;u<a.length-1;u++)if(this._seg.p0=a[u],this._seg.p1=a[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<A.x||this._seg.isHorizontal()||A.y<this._seg.p0.y||A.y>this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,A)===st.RIGHT)){var c=o.getDepth(Ie.LEFT);this._seg.p0.equals(a[u])||(c=o.getDepth(Ie.RIGHT));var l=new Bn(this._seg,c);s.add(l)}}else if(L(arguments[2],wt)&&arguments[0]instanceof C&&L(arguments[1],wt))for(var f=arguments[0],h=arguments[2],p=arguments[1].iterator();p.hasNext();){var d=p.next();d.isForward()&&this.findStabbedSegments(f,d,h)}},Rn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Ze.min(e)._leftDepth},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},kn.DepthSegment.get=function(){return Bn},Object.defineProperties(Rn,kn);var Bn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};Bn.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 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Bn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Bn.prototype.toString=function(){return this._upwardSeg.toString()},Bn.prototype.interfaces_=function(){return[b]},Bn.prototype.getClass=function(){return Bn};var Fn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Fn.prototype.area=function(){return Fn.area(this.p0,this.p1,this.p2)},Fn.prototype.signedArea=function(){return Fn.signedArea(this.p0,this.p1,this.p2)},Fn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return Fn.interpolateZ(t,this.p0,this.p1,this.p2)},Fn.prototype.longestSideLength=function(){return Fn.longestSideLength(this.p0,this.p1,this.p2)},Fn.prototype.isAcute=function(){return Fn.isAcute(this.p0,this.p1,this.p2)},Fn.prototype.circumcentre=function(){return Fn.circumcentre(this.p0,this.p1,this.p2)},Fn.prototype.area3D=function(){return Fn.area3D(this.p0,this.p1,this.p2)},Fn.prototype.centroid=function(){return Fn.centroid(this.p0,this.p1,this.p2)},Fn.prototype.inCentre=function(){return Fn.inCentre(this.p0,this.p1,this.p2)},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.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)},Fn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Fn.det=function(t,e,n,r){return t*r-e*n},Fn.interpolateZ=function(t,e,n,r){var i=e.x,A=e.y,o=n.x-i,s=r.x-i,a=n.y-A,u=r.y-A,c=o*u-s*a,l=t.x-i,f=t.y-A,h=(u*l-s*f)/c,p=(-a*l+o*f)/c;return e.z+h*(n.z-e.z)+p*(r.z-e.z)},Fn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),A=n.distance(t),o=r;return i>o&&(o=i),A>o&&(o=A),o},Fn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},Fn.circumcentre=function(t,e,n){var r=n.x,i=n.y,A=t.x-r,o=t.y-i,s=e.x-r,a=e.y-i,u=2*Fn.det(A,o,s,a),c=Fn.det(o,A*A+o*o,a,s*s+a*a),l=Fn.det(A,A*A+o*o,s,s*s+a*a);return new C(r-c/u,i+l/u)},Fn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Y(t.x+n/2,t.y+r/2,1),A=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(i,A)},Fn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),A=n.x-t.x,o=n.y-t.y;return new C(t.x+i*A,t.y+i*o)},Fn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,A=e.z-t.z,o=n.x-t.x,s=n.y-t.y,a=n.z-t.z,u=i*a-A*s,c=A*o-r*a,l=r*s-i*o,f=u*u+c*c+l*l;return Math.sqrt(f)/2},Fn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new C(r,i)},Fn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),A=t.distance(e),o=r+i+A,s=(r*t.x+i*e.x+A*n.x)/o,a=(r*t.y+i*e.y+A*n.y)/o;return new C(s,a)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ie.LEFT;this._distance<0&&(e=-this._distance,n=Ie.RIGHT);var r=t.getExteriorRing(),i=xt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,N.EXTERIOR,N.INTERIOR);for(var A=0;A<t.getNumInteriorRing();A++){var o=t.getInteriorRingN(A),s=xt.removeRepeatedPoints(o.getCoordinates());this._distance>0&&this.isErodedCompletely(o,-this._distance)||this.addPolygonRing(s,e,Ie.opposite(n),N.INTERIOR,N.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Fn(t[0],t[1],t[2]),r=n.inCentre();return st.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=xt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new pn(t,new Me(0,N.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var A=r,o=i;t.length>=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(A=i,o=r,n=Ie.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,A,o)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Zt?this.addPolygon(t):t instanceof Wt?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof qt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Un=function(){};Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Qn=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()};Qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Qn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof zt?(this._subcollectionIterator=new Qn(t),this._subcollectionIterator.next()):t},Qn.prototype.remove=function(){throw new Error(this.getClass().getName())},Qn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Qn.prototype.interfaces_=function(){return[bt]},Qn.prototype.getClass=function(){return Qn},Qn.isAtomic=function(t){return!(t instanceof zt)};var zn=function(){this._geom=null;var t=arguments[0];this._geom=t};zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(zn.isPointInRing(t,i))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Zt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new Qn(e);n.hasNext();){var r=n.next();if(r!==e&&zn.containsPoint(t,r))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?N.EXTERIOR:zn.containsPoint(t,e)?N.INTERIOR:N.EXTERIOR};var qn=function(){this._edgeMap=new l,this._edgeList=null,this._ptInAreaLocation=[N.NONE,N.NONE]};qn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},qn.prototype.propagateSideLabels=function(t){for(var e=N.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ie.LEFT)!==N.NONE&&(e=r.getLocation(t,Ie.LEFT))}if(e===N.NONE)return null;for(var i=e,A=this.iterator();A.hasNext();){var o=A.next(),s=o.getLabel();if(s.getLocation(t,Ie.ON)===N.NONE&&s.setLocation(t,Ie.ON,i),s.isArea(t)){var a=s.getLocation(t,Ie.LEFT),u=s.getLocation(t,Ie.RIGHT);if(u!==N.NONE){if(u!==i)throw new Ne("side location conflict",o.getCoordinate());a===N.NONE&&et.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),i=a}else et.isTrue(s.getLocation(t,Ie.LEFT)===N.NONE,"found single null side"),s.setLocation(t,Ie.RIGHT,i),s.setLocation(t,Ie.LEFT,i)}}},qn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},qn.prototype.print=function(t){V.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},qn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},qn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Ie.LEFT);et.isTrue(r!==N.NONE,"Found unlabelled area edge");for(var i=r,A=this.iterator();A.hasNext();){var o=A.next().getLabel();et.isTrue(o.isArea(t),"Found non-area edge");var s=o.getLocation(t,Ie.LEFT),a=o.getLocation(t,Ie.RIGHT);if(s===a)return!1;if(a!==i)return!1;i=s}return!0},qn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},qn.prototype.iterator=function(){return this.getEdges().iterator()},qn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Et(this._edgeMap.values())),this._edgeList},qn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===N.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},qn.prototype.toString=function(){var t=new O;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},qn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},qn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===N.BOUNDARY&&(e[i]=!0);for(var A=this.iterator();A.hasNext();)for(var o=A.next(),s=o.getLabel(),a=0;a<2;a++)if(s.isAnyNull(a)){var u=N.NONE;if(e[a])u=N.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(a,c,t)}s.setAllLocationsIfNull(a,u)}},qn.prototype.getDegree=function(){return this._edgeMap.size()},qn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var Vn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),A=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!A.isInResult())continue;e=A,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Ne("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),A=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(A)?n:Ge.isNorthern(i)||Ge.isNorthern(A)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){V.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Et;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ie.LEFT),r=t.getDepth(Ie.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Ne("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var A=arguments[1],o=arguments[2],s=arguments[0];s<A;s++){var a=this._edgeList.get(s);a.setEdgeDepths(Ie.RIGHT,o),o=a.getDepth(Ie.LEFT)}return o}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var A=this._resultAreaEdgeList.get(i),o=A.getSym();switch(null===e&&A.getEdgeRing()===t&&(e=A),r){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;n=o,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(A.getEdgeRing()!==t)continue;n.setNextMin(A),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=N.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=N.INTERIOR;break}if(r.isInResult()){t=N.EXTERIOR;break}}}if(t===N.NONE)return null;for(var i=t,A=this.iterator();A.hasNext();){var o=A.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(i===N.INTERIOR):(o.isInResult()&&(i=N.EXTERIOR),s.isInResult()&&(i=N.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Me(N.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var A=r.getLocation(i);A!==N.INTERIOR&&A!==N.BOUNDARY||this._label.setLocation(i,N.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Be(t,new Vn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qe),jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};jn.prototype.compareTo=function(t){var e=t;return jn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},jn.prototype.interfaces_=function(){return[b]},jn.prototype.getClass=function(){return jn},jn.orientation=function(t){return 1===xt.increasingDirection(t)},jn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,A=r?1:-1,o=e?t.length:-1,s=r?n.length:-1,a=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[a].compareTo(n[u]);if(0!==c)return c;var l=(a+=i)===o,f=(u+=A)===s;if(l&&!f)return-1;if(!l&&f)return 1;if(l&&f)return 0}};var Hn=function(){this._edges=new Et,this._ocaMap=new l};Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;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 jn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new jn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Xn=function(){};Xn.prototype.processIntersections=function(t,e,n,r){},Xn.prototype.isDone=function(){},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var Wn=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};Wn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Wn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Wn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Wn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Wn.prototype.getLineIntersector=function(){return this._li},Wn.prototype.hasProperIntersection=function(){return this._hasProper},Wn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,A,o,s),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)))},Wn.prototype.hasIntersection=function(){return this._hasIntersection},Wn.prototype.isDone=function(){return!1},Wn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Wn.prototype.interfaces_=function(){return[Xn]},Wn.prototype.getClass=function(){return Wn},Wn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var $n=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new C(t),this.segmentIndex=e,this.dist=n};$n.prototype.getSegmentIndex=function(){return this.segmentIndex},$n.prototype.getCoordinate=function(){return this.coord},$n.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},$n.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},$n.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},$n.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},$n.prototype.getDistance=function(){return this.dist},$n.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},$n.prototype.interfaces_=function(){return[b]},$n.prototype.getClass=function(){return $n};var Kn=function(){this._nodeMap=new l,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Kn.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)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var A=new Array(n).fill(null),o=0;A[o++]=new C(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)A[o++]=this.edge.pts[s];return i&&(A[o]=e.coord),new nr(A,new Me(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new $n(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new P(e));do{var r=this.findChainEnd(t,e);n.add(new P(r)),e=r}while(e<t.length-1);return Jn.toIntArray(n)},Jn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.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 Zn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new j,this.env2=new j;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Jn;this.startIndex=e.getChainStartIndices(this.pts)};Zn.prototype.getCoordinates=function(){return this.pts},Zn.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},Zn.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},Zn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){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(6===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=arguments[5],c=this.pts[i],l=this.pts[A],f=o.pts[s],h=o.pts[a];if(A-i==1&&a-s==1)return u.addIntersections(this.e,i,o.e,s),null;if(this.env1.init(c,l),this.env2.init(f,h),!this.env1.intersects(this.env2))return null;var p=Math.trunc((i+A)/2),d=Math.trunc((s+a)/2);i<p&&(s<d&&this.computeIntersectsForChain(i,p,o,s,d,u),d<a&&this.computeIntersectsForChain(i,p,o,d,a,u)),p<A&&(s<d&&this.computeIntersectsForChain(p,A,o,s,d,u),d<a&&this.computeIntersectsForChain(p,A,o,d,a,u))}},Zn.prototype.getStartIndexes=function(){return this.startIndex},Zn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var tr=function t(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ie.RIGHT]-this._depth[t][Ie.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?N.EXTERIOR:N.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==N.EXTERIOR&&r!==N.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],A=arguments[1];arguments[2]===N.INTERIOR&&this._depth[i][A]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===N.EXTERIOR?0:t===N.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Me.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,A=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(n.pts[o])||(r=!1),this.pts[o].equals2D(n.pts[--A])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Zn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new j;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new C(t.getIntersection(r)),A=e,o=t.getEdgeDistance(n,r),s=A+1;if(s<this.pts.length){var a=this.pts[s];i.equals2D(a)&&(A=s,o=0)}this.eiList.add(i,A,o)},e.prototype.toString=function(){var t=new O;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ie.ON),e.getLocation(1,Ie.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ie.LEFT),e.getLocation(1,Ie.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ie.RIGHT),e.getLocation(1,Ie.RIGHT),2))},e}(ke),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),A=e.getDepthDelta()+i;e.setDepthDelta(A)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new Et,r=t.iterator();r.hasNext();){var i=r.next(),A=i.getRightmostCoordinate(),o=new Rn(n).getDepth(A);i.computeDepth(o),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new Et,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Le;i.create(r),e.add(i)}}return Ze.sort(e,Ze.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Wn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Pn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ve(new Yn),this._graph.addEdges(this._edgeList.getEdges());var A=this.createSubgraphs(this._graph),o=new Ye(this._geomFact);this.buildSubgraphs(A,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),A=i.getCoordinates();if(2!==A.length||!A[0].equals2D(A[1])){var o=i.getData(),s=new nr(i.getCoordinates(),new Me(o));this.insertUniqueEdge(s)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ie.LEFT),n=t.getLocation(0,Ie.RIGHT);return e===N.INTERIOR&&n===N.EXTERIOR?1:e===N.EXTERIOR&&n===N.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ye,n=new Et;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){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(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],A=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=A,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&V.out.println(n)}},ir.prototype.scale=function(){if(L(arguments[0],vt)){for(var t=arguments[0],e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new pn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],A=new Array(i.length).fill(null),o=0;o<i.length;o++)A[o]=new C(Math.round((i[o].x-this._offsetX)*this._scaleFactor),Math.round((i[o].y-this._offsetY)*this._scaleFactor),i[o].z);return xt.removeRepeatedPoints(A)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[vn]},ir.prototype.getClass=function(){return ir};var Ar=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},or={fact:{configurable:!0}};Ar.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),A=1;A<i.length-1;A++)if(i[A].equals(n))throw new Z("found endpt/interior pt intersection at index "+A+" :pt "+n)},Ar.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],A=arguments[1],o=i.getCoordinates(),s=A.getCoordinates(),a=0;a<o.length-1;a++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(i,a,A,u);else if(4===arguments.length){var c=arguments[0],l=arguments[1],f=arguments[2],h=arguments[3];if(c===f&&l===h)return null;var p=c.getCoordinates()[l],d=c.getCoordinates()[l+1],g=f.getCoordinates()[h],y=f.getCoordinates()[h+1];if(this._li.computeIntersection(p,d,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,p,d)||this.hasInteriorIntersection(this._li,g,y)))throw new Z("found non-noded intersection at "+p+"-"+d+" and "+g+"-"+y)}},Ar.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Ar.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},Ar.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},Ar.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Z("found non-noded collapse at "+Ar.fact.createLineString([t,e,n]))},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},or.fact.get=function(){return new ye},Object.defineProperties(Ar,or);var sr=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 _("Scale factor must be non-zero");1!==e&&(this._pt=new C(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new C,this._p1Scaled=new C),this.initCorners(this._pt)},ar={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),A=Math.max(t.y,e.y),o=this._maxx<n||this._minx>r||this._maxy<i||this._miny>A;if(o)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(o&&s),"Found bad envelope test"),s},sr.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)},sr.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sr.prototype.getCoordinate=function(){return this._originalPt},sr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new j(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sr.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()))))},sr.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)))))},sr.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)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ar.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sr,ar);var ur=function(){this.tempEnv1=new j,this.selectedSegment=new dn};ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var cr=function(){this._index=null;var t=arguments[0];this._index=t},lr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),A=new fr(e,n,r);return this._index.query(i,{interfaces_:function(){return[We]},visitItem:function(t){t.select(i,A)}}),A.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},lr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(cr,lr);var fr=function(t){function e(){t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur),hr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};hr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,A,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)this._interiorIntersections.add(this._li.getIntersection(a));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},hr.prototype.isDone=function(){return!1},hr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},hr.prototype.interfaces_=function(){return[Xn]},hr.prototype.getClass=function(){return hr};var pr=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 it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};pr.prototype.checkCorrectness=function(t){var e=pn.getNodedSubstrings(t),n=new Ar(e);try{n.checkValid()}catch(t){if(!(t instanceof z))throw t;t.printStackTrace()}},pr.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},pr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},pr.prototype.findInteriorIntersections=function(t,e){var n=new hr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},pr.prototype.computeVertexSnaps=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof pn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var A=new sr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(A,n,i)&&n.addIntersection(r[i],i)}},pr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},pr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},pr.prototype.interfaces_=function(){return[vn]},pr.prototype.getClass=function(){return pr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Cn,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},gr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new ir(new pr(new he(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ne))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),i=new he(r);this.bufferFixedPrecision(i)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===he.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Z))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new dr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new dr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof Cn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new dr(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var A=arguments[1],o=arguments[2],s=arguments[3],a=new dr(arguments[0]);return a.setQuadrantSegments(o),a.setEndCapStyle(s),a.getResultGeometry(A)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=T.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),A=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,A)},gr.CAP_ROUND.get=function(){return Cn.CAP_ROUND},gr.CAP_BUTT.get=function(){return Cn.CAP_FLAT},gr.CAP_FLAT.get=function(){return Cn.CAP_FLAT},gr.CAP_SQUARE.get=function(){return Cn.CAP_SQUARE},gr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,gr);var yr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(t){return this._pt[t]},yr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},yr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){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(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},yr.prototype.getDistance=function(){return this._distance},yr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof Wt&&arguments[1]instanceof C)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new dn,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var A=r.closestPoint(t);e.setMinimum(A,t)}else if(arguments[2]instanceof yr&&arguments[0]instanceof Zt&&arguments[1]instanceof C){var o=arguments[0],s=arguments[1],a=arguments[2];_r.computeDistance(o.getExteriorRing(),s,a);for(var u=0;u<o.getNumInteriorRing();u++)_r.computeDistance(o.getInteriorRingN(u),s,a)}else if(arguments[2]instanceof yr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var c=arguments[0],l=arguments[1],f=arguments[2];if(c instanceof Wt)_r.computeDistance(c,l,f);else if(c instanceof Zt)_r.computeDistance(c,l,f);else if(c instanceof zt)for(var h=c,p=0;p<h.getNumGeometries();p++){var d=h.getGeometryN(p);_r.computeDistance(d,l,f)}else f.setMinimum(c.getCoordinate(),l)}else if(arguments[2]instanceof yr&&arguments[0]instanceof dn&&arguments[1]instanceof C){var g=arguments[1],y=arguments[2],_=arguments[0].closestPoint(g);y.setMinimum(_,g)}};var mr=function(t){this._maxPtDist=new yr,this._inputGeom=t||null},vr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},vr.MaxPointDistanceFilter.get=function(){return br},vr.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(mr,vr);var br=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};br.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},br.prototype.getMaxPointDistance=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[ht]},br.prototype.getClass=function(){return br};var wr=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new C((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[Qt]},wr.prototype.getClass=function(){return wr};var Er=function(t){this._comps=t||null};Er.prototype.filter=function(t){t instanceof Zt&&this._comps.add(t)},Er.prototype.interfaces_=function(){return[Ut]},Er.prototype.getClass=function(){return Er},Er.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Er.getPolygons(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof zt&&e.apply(new Er(n)),n}};var Cr=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Cr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Wt&&this._lines.add(t)},Cr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Cr.prototype.interfaces_=function(){return[ut]},Cr.prototype.getClass=function(){return Cr},Cr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Cr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Cr.getLines(e,n))}},Cr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Cr.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],vt)&&L(arguments[1],vt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();Cr.getLines(r,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var i=arguments[0],A=arguments[1],o=new Et;return i.apply(new Cr(o,A)),o}if(arguments[0]instanceof ct&&L(arguments[1],vt)){var s=arguments[0],a=arguments[1];return s instanceof Wt?a.add(s):s.apply(new Cr(a)),a}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],vt)&&L(arguments[1],vt)){for(var u=arguments[1],c=arguments[2],l=arguments[0].iterator();l.hasNext();){var f=l.next();Cr.getLines(f,u,c)}return u}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&L(arguments[1],vt)){var h=arguments[1],p=arguments[2];return arguments[0].apply(new Cr(h,p)),h}}};var Ir=function(){if(this._boundaryRule=pt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}};Ir.prototype.locateInternal=function(){if(arguments[0]instanceof C&&arguments[1]instanceof Zt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return N.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===N.EXTERIOR)return N.EXTERIOR;if(r===N.BOUNDARY)return N.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var A=e.getInteriorRingN(i),o=this.locateInPolygonRing(t,A);if(o===N.INTERIOR)return N.EXTERIOR;if(o===N.BOUNDARY)return N.BOUNDARY}return N.INTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof Wt){var s=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(s))return N.EXTERIOR;var u=a.getCoordinates();return a.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?st.isOnLine(s,u)?N.INTERIOR:N.EXTERIOR:N.BOUNDARY}if(arguments[0]instanceof C&&arguments[1]instanceof Kt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?N.INTERIOR:N.EXTERIOR}},Ir.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?st.locatePointInRing(t,e.getCoordinates()):N.EXTERIOR},Ir.prototype.intersects=function(t,e){return this.locate(t,e)!==N.EXTERIOR},Ir.prototype.updateLocationInfo=function(t){t===N.INTERIOR&&(this._isIn=!0),t===N.BOUNDARY&&this._numBoundaries++},Ir.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof qt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var A=e,o=0;o<A.getNumGeometries();o++){var s=A.getGeometryN(o);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof zt)for(var a=new Qn(e);a.hasNext();){var u=a.next();u!==e&&this.computeLocation(t,u)}},Ir.prototype.locate=function(t,e){return e.isEmpty()?N.EXTERIOR:e instanceof Wt||e instanceof Zt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?N.BOUNDARY:this._numBoundaries>0||this._isIn?N.INTERIOR:N.EXTERIOR)},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir};var xr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Sr={INSIDE_AREA:{configurable:!0}};xr.prototype.isInsideArea=function(){return this._segIndex===xr.INSIDE_AREA},xr.prototype.getCoordinate=function(){return this._pt},xr.prototype.getGeometryComponent=function(){return this._component},xr.prototype.getSegmentIndex=function(){return this._segIndex},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(xr,Sr);var Nr=function(t){this._pts=t||null};Nr.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Nr.prototype.interfaces_=function(){return[Ut]},Nr.prototype.getClass=function(){return Nr},Nr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Ze.singletonList(t):Nr.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof zt&&e.apply(new Nr(n)),n}};var Dr=function(){this._locations=null;var t=arguments[0];this._locations=t};Dr.prototype.filter=function(t){(t instanceof Kt||t instanceof Wt||t instanceof Zt)&&this._locations.add(new xr(t,0,t.getCoordinate()))},Dr.prototype.interfaces_=function(){return[Ut]},Dr.prototype.getClass=function(){return Dr},Dr.getLocations=function(t){var e=new Et;return t.apply(new Dr(e)),e};var Lr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ir,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=Er.getPolygons(this._geom[e]);if(i.size()>0){var A=Dr.getLocations(this._geom[r]);if(this.computeContainmentDistance(A,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=0;u<o.size();u++)for(var c=o.get(u),l=0;l<s.size();l++)if(this.computeContainmentDistance(c,s.get(l),a),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof xr&&arguments[1]instanceof Zt){var f=arguments[0],h=arguments[1],p=arguments[2],d=f.getCoordinate();if(N.EXTERIOR!==this._ptLocator.locate(d,h))return this._minDistance=0,p[0]=f,p[1]=new xr(h,d),null}},Lr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),A=0;A<e.size();A++){var o=e.get(A);if(this.computeMinDistance(i,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Cr.getLines(this._geom[0]),n=Cr.getLines(this._geom[1]),r=Nr.getPoints(this._geom[0]),i=Nr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),A=0;A<r.length-1;A++){var o=st.distancePointLine(i,r[A],r[A+1]);if(o<this._minDistance){this._minDistance=o;var s=new dn(r[A],r[A+1]).closestPoint(i);n[0]=new xr(t,A,s),n[1]=new xr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Wt){var a=arguments[0],u=arguments[1],c=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var l=a.getCoordinates(),f=u.getCoordinates(),h=0;h<l.length-1;h++)for(var p=0;p<f.length-1;p++){var d=st.distanceLineLine(l[h],l[h+1],f[p],f[p+1]);if(d<this._minDistance){this._minDistance=d;var g=new dn(l[h],l[h+1]),y=new dn(f[p],f[p+1]),_=g.closestPoints(y);c[0]=new xr(a,h,_[0]),c[1]=new xr(u,p,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),A=0;A<e.size();A++){var o=e.get(A),s=i.getCoordinate().distance(o.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,n[0]=new xr(i,0,i.getCoordinate()),n[1]=new xr(o,0,o.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),A=0;A<e.size();A++){var o=e.get(A);if(this.computeMinDistance(i,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Tr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},Tr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){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(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Tr.prototype.toString=function(){return J.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Mr=function(){};Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.computeDistance=function(){if(arguments[2]instanceof Tr&&arguments[0]instanceof Wt&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,i=t.getCoordinates(),A=0;A<i.length-1;A++){r.setCoordinates(i[A],i[A+1]);var o=r.closestPoint(e);n.setMinimum(o,e)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof Zt&&arguments[1]instanceof C){var s=arguments[0],a=arguments[1],u=arguments[2];Mr.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)Mr.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var l=arguments[0],f=arguments[1],h=arguments[2];if(l instanceof Wt)Mr.computeDistance(l,f,h);else if(l instanceof Zt)Mr.computeDistance(l,f,h);else if(l instanceof zt)for(var p=l,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);Mr.computeDistance(g,f,h)}else h.setMinimum(l.getCoordinate(),f)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof C){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var Or=function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Pr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.prototype.computeOrientedDistance=function(t,e,n){var r=new Rr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new kr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length)return new Or(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Or(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Pr.MaxPointDistanceFilter.get=function(){return Rr},Pr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Or,Pr);var Rr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Mr,this._geom=null;var t=arguments[0];this._geom=t};Rr.prototype.filter=function(t){this._minPtDist.initialize(),Mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Rr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Rr.prototype.interfaces_=function(){return[ht]},Rr.prototype.getClass=function(){return Rr};var kr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,A=(r.y-n.y)/this._numSubSegs,o=0;o<this._numSubSegs;o++){var s=n.x+o*i,a=n.y+o*A,u=new C(s,a);this._minPtDist.initialize(),Mr.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},kr.prototype.isDone=function(){return!1},kr.prototype.isGeometryChanged=function(){return!1},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[Qt]},kr.prototype.getClass=function(){return kr};var Br=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},Fr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Br.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+J.toLineString(i[0],i[1])+")"}},Br.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Br.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Br.VERBOSE&&V.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Br.prototype.checkNegativeValid=function(){if(!(this._input instanceof Zt||this._input instanceof ne||this._input instanceof zt))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)},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+J.toLineString(i[0],i[1])+" )"}},Br.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)},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.prototype.getPolygonLines=function(t){for(var e=new Et,n=new Cr(e),r=Er.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Br.prototype.getErrorMessage=function(){return this._errMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Fr.VERBOSE.get=function(){return!1},Fr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Fr);var Gr=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},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.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},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new j(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new j(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")},Gr.prototype.checkDistance=function(){var t=new Br(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")},Gr.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")},Gr.prototype.checkPolygonal=function(){this._result instanceof Zt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;V.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var Qr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Qr.prototype.getCoordinates=function(){return this._pts},Qr.prototype.size=function(){return this._pts.length},Qr.prototype.getCoordinate=function(t){return this._pts[t]},Qr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Qr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ln.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Qr.prototype.setData=function(t){this._data=t},Qr.prototype.getData=function(){return this._data},Qr.prototype.toString=function(){return J.toLineString(new ae(this._pts))},Qr.prototype.interfaces_=function(){return[fn]},Qr.prototype.getClass=function(){return Qr};var zr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zr.prototype.getIntersectionSegments=function(){return this._intSegments},zr.prototype.count=function(){return this._intersectionCount},zr.prototype.getIntersections=function(){return this._intersections},zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,A,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=A,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zr.prototype.interfaces_=function(){return[Xn]},zr.prototype.getClass=function(){return zr},zr.createAllIntersectionsFinder=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e},zr.createAnyIntersectionFinder=function(t){return new zr(t)},zr.createIntersectionCounter=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var qr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};qr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},qr.prototype.getIntersections=function(){return this._segInt.getIntersections()},qr.prototype.isValid=function(){return this.execute(),this._isValid},qr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},qr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ne(this.getErrorMessage(),this._segInt.getInteriorIntersection())},qr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3])},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.computeIntersections=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Vr=function t(){this._nv=null;var e=arguments[0];this._nv=new qr(t.toSegmentStrings(e))};Vr.prototype.checkValid=function(){this._nv.checkValid()},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.toSegmentStrings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Qr(r.getCoordinates(),r))}return e},Vr.checkValid=function(t){new Vr(t).checkValid()};var Yr=function(t){this._mapOp=t};Yr.prototype.map=function(t){for(var e=new Et,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ye.toGeometryArray(e))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.map=function(t,e){return new Yr(e).map(t)};var jr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Et,this._resultLineList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};jr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},jr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},jr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},jr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!xi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},jr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},jr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},jr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},jr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(xi.isResultOfOp(r,e)&&e===xi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Et;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==xi.INTERSECTION)){var r=n.getLabel();xi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Xr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Xr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new Et,A=0;A<t.getNumInteriorRing();A++){var o=this.transformLinearRing(t.getInteriorRingN(A),t);null===o||o.isEmpty()||(o instanceof ee||(n=!1),i.add(o))}if(n)return this._factory.createPolygon(r,i.toArray([]));var s=new Et;return null!==r&&s.add(r),s.addAll(i),this._factory.buildGeometry(s)},Xr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Xr.prototype.getInputGeometry=function(){return this._inputGeom},Xr.prototype.transformMultiLineString=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Xr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Xr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformMultiPoint=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Xr.prototype.transformMultiPolygon=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Xr.prototype.copy=function(t){return t.copy()},Xr.prototype.transformGeometryCollection=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ye.toGeometryArray(n)):this._factory.buildGeometry(n)},Xr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Wt)return this.transformLineString(t,null);if(t instanceof qt)return this.transformMultiLineString(t,null);if(t instanceof Zt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Xr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var Wr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Wt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Wr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),A=this.findSnapForVertex(i,e);null!==A&&(t.set(r,new C(A)),0===r&&this._isClosed&&t.set(t.size()-1,new C(A)))}},Wr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Wr.prototype.snapTo=function(t){var e=new It(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Wr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],A=this.findSegmentIndexToSnap(i,t);A>=0&&t.add(A+1,new C(i),!1)}},Wr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var A=this._seg.distance(t);A<this._snapTolerance&&A<n&&(n=A,r=i)}return r},Wr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var $r=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};$r.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Jr(e,n).transform(this._srcGeom)},$r.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Jr(t,n,!0).transform(this._srcGeom),i=r;return e&&L(i,Jt)&&(i=r.buffer(0)),i},$r.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},$r.prototype.extractTargetCoordinates=function(t){for(var e=new h,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},$r.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.snap=function(t,e,n){var r=new Array(2).fill(null),i=new $r(t);r[0]=i.snapTo(e,n);var A=new $r(e);return r[1]=A.snapTo(r[0],n),r},$r.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=$r.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===he.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],A=arguments[1];return Math.min($r.computeOverlaySnapTolerance(i),$r.computeOverlaySnapTolerance(A))}},$r.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*$r.SNAP_PRECISION_FACTOR},$r.snapToSelf=function(t,e,n){return new $r(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties($r,Kr);var Jr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr),Zr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Zr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Zr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Zr.signExpBits(this._commonBits),this._isFirst=!1,null):Zr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Zr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Zr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Zr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.getBit=function(t,e){return t&1<<e?1:0},Zr.signExpBits=function(t){return t>>52},Zr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Zr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Zr.getBit(t,r)!==Zr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new C(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Zr,this._commonBitsY=new Zr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new C(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ht]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.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)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Qt]},ri.prototype.getClass=function(){return ri};var ii=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()};ii.prototype.selfSnap=function(t){return new $r(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,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},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=xi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||V.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=$r.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return $r.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,xi.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,xi.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,xi.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,xi.DIFFERENCE)};var Ai=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Ai.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=xi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Z))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Z?r:t}return e},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.overlayOp=function(t,e,n){return new Ai(t,e).getResultGeometry(n)},Ai.union=function(t,e){return Ai.overlayOp(t,e,xi.UNION)},Ai.intersection=function(t,e){return Ai.overlayOp(t,e,xi.INTERSECTION)},Ai.symDifference=function(t,e){return Ai.overlayOp(t,e,xi.SYMDIFFERENCE)},Ai.difference=function(t,e){return Ai.overlayOp(t,e,xi.DIFFERENCE)};var oi=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};oi.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=A}},ai={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.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},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[b]},si.prototype.getClass=function(){return si},ai.INSERT.get=function(){return 1},ai.DELETE.get=function(){return 2},Object.defineProperties(si,ai);var ui=function(){};ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var ci=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};ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,A,o,s),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))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var li=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Ze.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ci&&L(arguments[0],wt)&&L(arguments[1],wt)){var r=arguments[0],i=arguments[1],A=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(A)}else if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&arguments[1]instanceof ci){var o=arguments[0],s=arguments[1];arguments[2]?this.addEdges(o,null):this.addEdges(o),this.computeIntersections(s)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var A=new oi(n,i),o=new si(e,n.getMinX(i),A);this.events.add(o),this.events.add(new si(n.getMaxX(i),o))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),A=t;A<e;A++){var o=this.events.get(A);if(o.isInsert()){var s=o.getObject();n.isSameLabel(o)||(i.computeIntersections(s,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ui),fi=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},hi={NodeComparator:{configurable:!0}};fi.prototype.getMin=function(){return this._min},fi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fi.prototype.getMax=function(){return this._max},fi.prototype.toString=function(){return J.toLineString(new C(this._min,0),new C(this._max,0))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},hi.NodeComparator.get=function(){return pi},Object.defineProperties(fi,hi);var pi=function(){};pi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,A=(r._min+r._max)/2;return i<A?-1:i>A?1:0},pi.prototype.interfaces_=function(){return[E]},pi.prototype.getClass=function(){return pi};var di=function(t){function e(){t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),gi=function(t){function e(){t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),yi=function(){this._leaves=new Et,this._root=null,this._level=0};yi.prototype.buildTree=function(){Ze.sort(this._leaves,new fi.NodeComparator);for(var t=this._leaves,e=null,n=new Et;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},yi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new di(t,e,n))},yi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},yi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yi.prototype.printNode=function(t){V.out.println(J.toLineString(new C(t._min,this._level),new C(t._max,this._level)))},yi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new gi(t.get(n),t.get(n+1));e.add(i)}}},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var _i=function(){this._items=new Et};_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[We]},_i.prototype.getClass=function(){return _i};var mi=function(){this._index=null;var t=arguments[0];if(!L(t,Jt))throw new _("Argument must be Polygonal");this._index=new wi(t)},vi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mi.prototype.locate=function(t){var e=new ot(t),n=new bi(e);return this._index.query(t.y,t.y,n),e.getLocation()},mi.prototype.interfaces_=function(){return[Un]},mi.prototype.getClass=function(){return mi},vi.SegmentVisitor.get=function(){return bi},vi.IntervalIndexedGeometry.get=function(){return wi},Object.defineProperties(mi,vi);var bi=function(){this._counter=null;var t=arguments[0];this._counter=t};bi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},bi.prototype.interfaces_=function(){return[We]},bi.prototype.getClass=function(){return bi};var wi=function(){this._index=new yi;var t=arguments[0];this.init(t)};wi.prototype.init=function(t){for(var e=Cr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2];this._index.query(r,i,A)}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Ei=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new fe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ir,2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2];this._argIndex=i,this._parentGeom=A,this._boundaryNodeRule=o,null!==A&&this.add(A)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;N.NONE,r.getLocation(t,Ie.ON)===N.BOUNDARY&&i++;var A=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,A)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var A=this.createEdgeSetIntersector(),o=this._parentGeom instanceof ee||this._parentGeom instanceof Zt||this._parentGeom instanceof ne,s=n||!o;return A.computeIntersections(this._edges,i,s),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ci(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,N.INTERIOR)}else if(arguments[0]instanceof C){var e=arguments[0];this.insertPoint(this._argIndex,e,N.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),N.EXTERIOR,N.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,N.INTERIOR,N.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],N.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],N.BOUNDARY)},e.prototype.addLineString=function(t){var e=xt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Me(this._argIndex,N.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===N.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=xt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,A=n;st.isCCW(r)&&(i=n,A=e);var o=new nr(r,new Me(this._argIndex,N.BOUNDARY,i,A));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],N.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Me(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new li},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var A=i.next();this.addSelfIntersectionNode(t,A.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Zt)this.addPolygon(e);else if(e instanceof Wt)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof qt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?N.BOUNDARY:N.INTERIOR},e}(Ve),Ci=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.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 Ei(0,e,r),this._arg[1]=new Ei(1,n,r)}else if(3===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2];i.getPrecisionModel().compareTo(A.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(A.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,o),this._arg[1]=new Ei(1,A,o)}};Ci.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ci.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Ii=function(){};Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],Ii.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Et,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(L(arguments[0],vt)&&L(arguments[1],Ii.MapOp)){for(var A=arguments[0],o=arguments[1],s=new Et,a=A.iterator();a.hasNext();){var u=a.next(),c=o.map(u);null!==c&&s.add(c)}return s}},Ii.MapOp=function(){};var xi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Ir,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new Et,this._resultLineList=new Et,this._resultPointList=new Et,this._graph=new Ve(new Yn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var A=new Et;return A.addAll(t),A.addAll(n),A.addAll(r),A.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(A)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==N.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Et,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){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 e=new Et;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Vr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ye(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new jr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ie.RIGHT),i.getLocation(1,Ie.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Ie.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ie.LEFT,r.getLocation(i,Ie.LEFT)),et.isTrue(!r.isNull(i,Ie.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ie.RIGHT,r.getLocation(i,Ie.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ci);xi.overlayOp=function(t,e,n){return new xi(t,e).getResultGeometry(n)},xi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return xi.createEmptyResult(xi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Yr.map(t,{interfaces_:function(){return[Ii.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.INTERSECTION)},xi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xi.createEmptyResult(xi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.SYMDIFFERENCE)},xi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),A=-1;switch(t){case xi.INTERSECTION:A=Math.min(r,i);break;case xi.UNION:A=Math.max(r,i);break;case xi.DIFFERENCE:A=r;break;case xi.SYMDIFFERENCE:A=Math.max(r,i)}return A},xi.createEmptyResult=function(t,e,n,r){var i=null;switch(xi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},xi.difference=function(t,e){return t.isEmpty()?xi.createEmptyResult(xi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.DIFFERENCE))},xi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return xi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2];switch(i===N.BOUNDARY&&(i=N.INTERIOR),A===N.BOUNDARY&&(A=N.INTERIOR),o){case xi.INTERSECTION:return i===N.INTERIOR&&A===N.INTERIOR;case xi.UNION:return i===N.INTERIOR||A===N.INTERIOR;case xi.DIFFERENCE:return i===N.INTERIOR&&A!==N.INTERIOR;case xi.SYMDIFFERENCE:return i===N.INTERIOR&&A!==N.INTERIOR||i!==N.INTERIOR&&A===N.INTERIOR}return!1}},xi.INTERSECTION=1,xi.UNION=2,xi.DIFFERENCE=3,xi.SYMDIFFERENCE=4;var Si=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ir,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Si.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?N.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Ni;t.apply(e);var n=e.getLinework(),r=ye.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Ni=function(){this._linework=null,this._linework=new Et};Ni.prototype.getLinework=function(){return this._linework},Ni.prototype.filter=function(t){if(t instanceof Zt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Ni.prototype.interfaces_=function(){return[Ut]},Ni.prototype.getClass=function(){return Ni};var Di=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Di.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Di.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Di.prototype.getPoints=function(t){for(var e=new Et,n=Cr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Di.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,A=e.y-t.y,o=Math.sqrt(i*i+A*A),s=n*i/o,a=n*A/o,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var l=new C(u-a,c+s);r.add(l)}if(this._doRight){var f=new C(u+a,c-s);r.add(f)}},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var Li=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new Et;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]},Ti={TOLERANCE:{configurable:!0}};Li.prototype.reportResult=function(t,e,n){V.out.println("Overlay result invalid - A:"+N.toLocationSymbol(e[0])+" B:"+N.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+N.toLocationSymbol(e[2]))},Li.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Li.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Li.hasLocation(this._location,N.BOUNDARY)||this.isValidResult(r,this._location)}},Li.prototype.addTestPts=function(t){var e=new Di(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Li.prototype.isValidResult=function(t,e){var n=xi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===N.INTERIOR);return r||this.reportResult(t,e,n),r},Li.prototype.getInvalidLocation=function(){return this._invalidLocation},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Li.computeBoundaryDistanceTolerance=function(t,e){return Math.min($r.computeSizeBasedSnapTolerance(t),$r.computeSizeBasedSnapTolerance(e))},Li.isValid=function(t,e,n,r){return new Li(t,e,r).isValid(n)},Ti.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Li,Ti);var Mi=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Mi.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Mi.prototype.combine=function(){for(var t=new Et,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.combine=function(){if(1===arguments.length)return new Mi(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Mi(Mi.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Mi(Mi.createList(n,r,i)).combine()}},Mi.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Mi.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Et;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2],o=new Et;return o.add(r),o.add(i),o.add(A),o}};var Oi=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Et)},Pi={STRTREE_NODE_CAPACITY:{configurable:!0}};Oi.prototype.reduceToGeometries=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next(),i=null;L(r,wt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Oi.prototype.extractByEnvelope=function(t,e,n){for(var r=new Et,i=0;i<e.getNumGeometries();i++){var A=e.getGeometryN(i);A.getEnvelopeInternal().intersects(t)?r.add(A):n.add(A)}return this._geomFactory.buildGeometry(r)},Oi.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Mi.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Oi.prototype.union=function(){if(null===this._inputPolys)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 on(Oi.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();return this.unionTree(r)},Oi.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Oi.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Oi.getGeometry(e,n),Oi.getGeometry(e,n+1));var A=Math.trunc((r+n)/2),o=this.binaryUnion(e,n,A),s=this.binaryUnion(e,A,r);return this.unionSafe(o,s)}},Oi.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Oi.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Oi.prototype.unionActual=function(t,e){return Oi.restrictToPolygons(t.union(e))},Oi.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Oi.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Et,i=this.extractByEnvelope(n,t,r),A=this.extractByEnvelope(n,e,r),o=this.unionActual(i,A);return r.add(o),Mi.combine(r)},Oi.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.restrictToPolygons=function(t){if(L(t,Jt))return t;var e=Er.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ye.toPolygonArray(e))},Oi.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Oi.union=function(t){return new Oi(t).union()},Pi.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Oi,Pi);var Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xi.createEmptyResult(xi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Ce,t.OverlayOp=xi,t.UnionOp=Ri,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})})(Mt.exports);var Ot=Mt.exports;function Pt(){return new Rt}function Rt(){this.reset()}Rt.prototype={constructor:Rt,reset:function(){this.s=this.t=0},add:function(t){Bt(kt,t,this.t),Bt(this,kt.s,this.s),this.s?this.t+=kt.t:this.s=kt.t},valueOf:function(){return this.s}};var kt=new Rt;function Bt(t,e,n){var r=t.s=e+n,i=r-e,A=r-i;t.t=e-A+(n-i)}var Ft=1e-6,Gt=Math.PI,Ut=Gt/2,Qt=Gt/4,zt=2*Gt,qt=180/Gt,Vt=Gt/180,Yt=Math.abs,jt=Math.atan,Ht=Math.atan2,Xt=Math.cos,Wt=Math.sin,$t=Math.sqrt;function Kt(t){return t>1?0:t<-1?Gt:Math.acos(t)}function Jt(t){return t>1?Ut:t<-1?-Ut:Math.asin(t)}function Zt(){}function te(t,e){t&&ie.hasOwnProperty(t.type)&&ie[t.type](t,e)}var ee,ne,re={Feature:function(t,e){te(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)te(n[r].geometry,e)}},ie={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Ae(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ae(n[r],e,0)},Polygon:function(t,e){oe(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)oe(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)te(n[r],e)}};function Ae(t,e,n){var r,i=-1,A=t.length-n;for(e.lineStart();++i<A;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function oe(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Ae(t[n],e,1);e.polygonEnd()}function se(t){return[Ht(t[1],t[0]),Jt(t[2])]}function ae(t){var e=t[0],n=t[1],r=Xt(n);return[r*Xt(e),r*Wt(e),Wt(n)]}function ue(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ce(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function le(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function fe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function he(t){var e=$t(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function pe(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function de(t,e){return[t>Gt?t-zt:t<-Gt?t+zt:t,e]}function ge(t){return function(e,n){return[(e+=t)>Gt?e-zt:e<-Gt?e+zt:e,n]}}function ye(t){var e=ge(t);return e.invert=ge(-t),e}function _e(t,e){var n=Xt(t),r=Wt(t),i=Xt(e),A=Wt(e);function o(t,e){var o=Xt(e),s=Xt(t)*o,a=Wt(t)*o,u=Wt(e),c=u*n+s*r;return[Ht(a*i-c*A,s*n-u*r),Jt(c*i+a*A)]}return o.invert=function(t,e){var o=Xt(e),s=Xt(t)*o,a=Wt(t)*o,u=Wt(e),c=u*i-a*A;return[Ht(a*i+u*A,s*n+c*r),Jt(c*n-s*r)]},o}function me(t,e){(e=ae(e))[0]-=t,he(e);var n=Kt(-e[1]);return((-e[2]<0?-n:n)+zt-Ft)%zt}function ve(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Zt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function be(t,e){return Yt(t[0]-e[0])<Ft&&Yt(t[1]-e[1])<Ft}function we(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ee(t,e,n,r,i){var A,o,s=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(be(r,o)){for(i.lineStart(),A=0;A<e;++A)i.point((r=t[A])[0],r[1]);i.lineEnd()}else s.push(n=new we(r,t,null,!0)),a.push(n.o=new we(r,null,n,!1)),s.push(n=new we(o,t,null,!1)),a.push(n.o=new we(o,null,n,!0))}}),s.length){for(a.sort(e),Ce(s),Ce(a),A=0,o=a.length;A<o;++A)a[A].e=n=!n;for(var u,c,l=s[0];;){for(var f=l,h=!0;f.v;)if((f=f.n)===l)return;u=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(A=0,o=u.length;A<o;++A)i.point((c=u[A])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(h)for(u=f.p.z,A=u.length-1;A>=0;--A)i.point((c=u[A])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);i.lineEnd()}}}function Ce(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Ie(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function xe(t){for(var e,n,r,i=t.length,A=-1,o=0;++A<i;)o+=t[A].length;for(n=new Array(o);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n}Pt(),Pt(),Pt(),de.invert=de,1===(ee=Ie).length&&(ne=ee,ee=function(t,e){return Ie(ne(t),e)});var Se=1e9,Ne=-Se;function De(t,e,n,r){function i(i,A){return t<=i&&i<=n&&e<=A&&A<=r}function A(i,A,s,u){var c=0,l=0;if(null==i||(c=o(i,s))!==(l=o(A,s))||a(i,A)<0^s>0)do{u.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==l);else u.point(A[0],A[1])}function o(r,i){return Yt(r[0]-t)<Ft?i>0?0:3:Yt(r[0]-n)<Ft?i>0?2:1:Yt(r[1]-e)<Ft?i>0?1:0:i>0?3:2}function s(t,e){return a(t.x,e.x)}function a(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var a,u,c,l,f,h,p,d,g,y,_,m=o,v=ve(),b={point:w,lineStart:function(){b.point=E,u&&u.push(c=[]);y=!0,g=!1,p=d=NaN},lineEnd:function(){a&&(E(l,f),h&&g&&v.rejoin(),a.push(v.result()));b.point=w,g&&m.lineEnd()},polygonStart:function(){m=v,a=[],u=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=u.length;n<i;++n)for(var A,o,s=u[n],a=1,c=s.length,l=s[0],f=l[0],h=l[1];a<c;++a)A=f,o=h,f=(l=s[a])[0],h=l[1],o<=r?h>r&&(f-A)*(r-o)>(h-o)*(t-A)&&++e:h<=r&&(f-A)*(r-o)<(h-o)*(t-A)&&--e;return e}(),n=_&&e,i=(a=xe(a)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),A(null,null,1,o),o.lineEnd()),i&&Ee(a,s,e,A,o),o.polygonEnd());m=o,a=u=c=null}};function w(t,e){i(t,e)&&m.point(t,e)}function E(A,o){var s=i(A,o);if(u&&c.push([A,o]),y)l=A,f=o,h=s,y=!1,s&&(m.lineStart(),m.point(A,o));else if(s&&g)m.point(A,o);else{var a=[p=Math.max(Ne,Math.min(Se,p)),d=Math.max(Ne,Math.min(Se,d))],v=[A=Math.max(Ne,Math.min(Se,A)),o=Math.max(Ne,Math.min(Se,o))];!function(t,e,n,r,i,A){var o,s=t[0],a=t[1],u=0,c=1,l=e[0]-s,f=e[1]-a;if(o=n-s,l||!(o>0)){if(o/=l,l<0){if(o<u)return;o<c&&(c=o)}else if(l>0){if(o>c)return;o>u&&(u=o)}if(o=i-s,l||!(o<0)){if(o/=l,l<0){if(o>c)return;o>u&&(u=o)}else if(l>0){if(o<u)return;o<c&&(c=o)}if(o=r-a,f||!(o>0)){if(o/=f,f<0){if(o<u)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>u&&(u=o)}if(o=A-a,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o<u)return;o<c&&(c=o)}return u>0&&(t[0]=s+u*l,t[1]=a+u*f),c<1&&(e[0]=s+c*l,e[1]=a+c*f),!0}}}}}(a,v,t,e,n,r)?s&&(m.lineStart(),m.point(A,o),_=!1):(g||(m.lineStart(),m.point(a[0],a[1])),m.point(v[0],v[1]),s||m.lineEnd(),_=!1)}p=A,d=o,g=s}return b}}var Le=Pt();function Te(t){return t}Pt(),Pt(),Pt();var Me=1/0,Oe=Me,Pe=-Me,Re=Pe,ke={point:function(t,e){t<Me&&(Me=t);t>Pe&&(Pe=t);e<Oe&&(Oe=e);e>Re&&(Re=e)},lineStart:Zt,lineEnd:Zt,polygonStart:Zt,polygonEnd:Zt,result:function(){var t=[[Me,Oe],[Pe,Re]];return Pe=Re=-(Oe=Me=1/0),t}};function Be(t,e,n,r){return function(i,A){var o,s,a,u=e(A),c=i.invert(r[0],r[1]),l=ve(),f=e(l),h=!1,p={point:d,lineStart:y,lineEnd:_,polygonStart:function(){p.point=m,p.lineStart=v,p.lineEnd=b,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=_,s=xe(s);var t=function(t,e){var n=e[0],r=e[1],i=[Wt(n),-Xt(n),0],A=0,o=0;Le.reset();for(var s=0,a=t.length;s<a;++s)if(c=(u=t[s]).length)for(var u,c,l=u[c-1],f=l[0],h=l[1]/2+Qt,p=Wt(h),d=Xt(h),g=0;g<c;++g,f=_,p=v,d=b,l=y){var y=u[g],_=y[0],m=y[1]/2+Qt,v=Wt(m),b=Xt(m),w=_-f,E=w>=0?1:-1,C=E*w,I=C>Gt,x=p*v;if(Le.add(Ht(x*E*Wt(C),d*b+x*Xt(C))),A+=I?w+E*zt:w,I^f>=n^_>=n){var S=ce(ae(l),ae(y));he(S);var N=ce(i,S);he(N);var D=(I^w>=0?-1:1)*Jt(N[2]);(r>D||r===D&&(S[0]||S[1]))&&(o+=I^w>=0?1:-1)}}return(A<-Ft||A<Ft&&Le<-Ft)^1&o}(o,c);s.length?(h||(A.polygonStart(),h=!0),Ee(s,Ge,t,n,A)):t&&(h||(A.polygonStart(),h=!0),A.lineStart(),n(null,null,1,A),A.lineEnd()),h&&(A.polygonEnd(),h=!1),s=o=null},sphere:function(){A.polygonStart(),A.lineStart(),n(null,null,1,A),A.lineEnd(),A.polygonEnd()}};function d(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&A.point(e,n)}function g(t,e){var n=i(t,e);u.point(n[0],n[1])}function y(){p.point=g,u.lineStart()}function _(){p.point=d,u.lineEnd()}function m(t,e){a.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function v(){f.lineStart(),a=[]}function b(){m(a[0][0],a[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),u=l.result(),c=u.length;if(a.pop(),o.push(a),a=null,c)if(1&i){if((e=(n=u[0]).length-1)>0){for(h||(A.polygonStart(),h=!0),A.lineStart(),t=0;t<e;++t)A.point((r=n[t])[0],r[1]);A.lineEnd()}}else c>1&&2&i&&u.push(u.pop().concat(u.shift())),s.push(u.filter(Fe))}return p}}function Fe(t){return t.length>1}function Ge(t,e){return((t=t.x)[0]<0?t[1]-Ut-Ft:Ut-t[1])-((e=e.x)[0]<0?e[1]-Ut-Ft:Ut-e[1])}Pt();var Ue=Be(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(A,o){var s=A>0?Gt:-Gt,a=Yt(A-n);Yt(a-Gt)<Ft?(t.point(n,r=(r+o)/2>0?Ut:-Ut),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(A,r),e=0):i!==s&&a>=Gt&&(Yt(n-i)<Ft&&(n-=i*Ft),Yt(A-s)<Ft&&(A-=s*Ft),r=function(t,e,n,r){var i,A,o=Wt(t-n);return Yt(o)>Ft?jt((Wt(e)*(A=Xt(r))*Wt(n)-Wt(r)*(i=Xt(e))*Wt(t))/(i*A*o)):(e+r)/2}(n,r,A,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=A,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Ut,r.point(-Gt,i),r.point(0,i),r.point(Gt,i),r.point(Gt,0),r.point(Gt,-i),r.point(0,-i),r.point(-Gt,-i),r.point(-Gt,0),r.point(-Gt,i);else if(Yt(t[0]-e[0])>Ft){var A=t[0]<e[0]?Gt:-Gt;i=n*A/2,r.point(-A,i),r.point(0,i),r.point(A,i)}else r.point(e[0],e[1])},[-Gt,-Ut]);function Qe(t,e){var n=Xt(t),r=n>0,i=Yt(n)>Ft;function A(t,e){return Xt(t)*Xt(e)>n}function o(t,e,r){var i=[1,0,0],A=ce(ae(t),ae(e)),o=ue(A,A),s=A[0],a=o-s*s;if(!a)return!r&&t;var u=n*o/a,c=-n*s/a,l=ce(i,A),f=fe(i,u);le(f,fe(A,c));var h=l,p=ue(f,h),d=ue(h,h),g=p*p-d*(ue(f,f)-1);if(!(g<0)){var y=$t(g),_=fe(h,(-p-y)/d);if(le(_,f),_=se(_),!r)return _;var m,v=t[0],b=e[0],w=t[1],E=e[1];b<v&&(m=v,v=b,b=m);var C=b-v,I=Yt(C-Gt)<Ft;if(!I&&E<w&&(m=w,w=E,E=m),I||C<Ft?I?w+E>0^_[1]<(Yt(_[0]-v)<Ft?w:E):w<=_[1]&&_[1]<=E:C>Gt^(v<=_[0]&&_[0]<=b)){var x=fe(h,(-p+y)/d);return le(x,f),[_,se(x)]}}}function s(e,n){var i=r?t:Gt-t,A=0;return e<-i?A|=1:e>i&&(A|=2),n<-i?A|=4:n>i&&(A|=8),A}return Be(A,function(t){var e,n,a,u,c;return{lineStart:function(){u=a=!1,c=1},point:function(l,f){var h,p=[l,f],d=A(l,f),g=r?d?0:s(l,f):d?s(l+(l<0?Gt:-Gt),f):0;if(!e&&(u=a=d)&&t.lineStart(),d!==a&&(!(h=o(e,p))||be(e,h)||be(p,h))&&(p[0]+=Ft,p[1]+=Ft,d=A(p[0],p[1])),d!==a)c=0,d?(t.lineStart(),h=o(p,e),t.point(h[0],h[1])):(h=o(e,p),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(i&&e&&r^d){var y;g&n||!(y=o(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!d||e&&be(e,p)||t.point(p[0],p[1]),e=p,a=d,n=g},lineEnd:function(){a&&t.lineEnd(),e=null},clean:function(){return c|(u&&a)<<1}}},function(n,r,i,A){!function(t,e,n,r,i,A){if(n){var o=Xt(e),s=Wt(e),a=r*n;null==i?(i=e+r*zt,A=e-a/2):(i=me(o,i),A=me(o,A),(r>0?i<A:i>A)&&(i+=r*zt));for(var u,c=i;r>0?c>A:c<A;c-=a)u=se([o,-s*Xt(c),-s*Wt(c)]),t.point(u[0],u[1])}}(A,t,e,i,n,r)},r?[0,-t]:[-Gt,t-Gt])}function ze(t){return function(e){var n=new qe;for(var r in t)n[r]=t[r];return n.stream=e,n}}function qe(){}function Ve(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],A=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=A&&t.clipExtent(null),function(t,e){t&&re.hasOwnProperty(t.type)?re[t.type](t,e):te(t,e)}(n,t.stream(ke));var o=ke.result(),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),a=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return null!=A&&t.clipExtent(A),t.scale(150*s).translate([a,u])}qe.prototype={constructor:qe,point:function(t,e){this.stream.point(t,e)},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()}};var Ye=Xt(30*Vt);function je(t,e){return+e?function(t,e){function n(r,i,A,o,s,a,u,c,l,f,h,p,d,g){var y=u-r,_=c-i,m=y*y+_*_;if(m>4*e&&d--){var v=o+f,b=s+h,w=a+p,E=$t(v*v+b*b+w*w),C=Jt(w/=E),I=Yt(Yt(w)-1)<Ft||Yt(A-l)<Ft?(A+l)/2:Ht(b,v),x=t(I,C),S=x[0],N=x[1],D=S-r,L=N-i,T=_*D-y*L;(T*T/m>e||Yt((y*D+_*L)/m-.5)>.3||o*f+s*h+a*p<Ye)&&(n(r,i,A,o,s,a,S,N,I,v/=E,b/=E,w,d,g),g.point(S,N),n(S,N,I,v,b,w,u,c,l,f,h,p,d,g))}}return function(e){var r,i,A,o,s,a,u,c,l,f,h,p,d={point:g,lineStart:y,lineEnd:m,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=y}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,d.point=_,e.lineStart()}function _(r,i){var A=ae([r,i]),o=t(r,i);n(c,l,u,f,h,p,c=o[0],l=o[1],u=r,f=A[0],h=A[1],p=A[2],16,e),e.point(c,l)}function m(){d.point=g,e.lineEnd()}function v(){y(),d.point=b,d.lineEnd=w}function b(t,e){_(r=t,e),i=c,A=l,o=f,s=h,a=p,d.point=_}function w(){n(c,l,u,f,h,p,i,A,r,o,s,a,16,e),d.lineEnd=m,m()}return d}}(t,e):function(t){return ze({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var He=ze({point:function(t,e){this.stream.point(t*Vt,e*Vt)}});function Xe(t){return function(t){var e,n,r,i,A,o,s,a,u,c,l=150,f=480,h=250,p=0,d=0,g=0,y=0,_=0,m=null,v=Ue,b=null,w=Te,E=.5,C=je(S,E);function I(t){return[(t=A(t[0]*Vt,t[1]*Vt))[0]*l+n,r-t[1]*l]}function x(t){return(t=A.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*qt,t[1]*qt]}function S(t,i){return[(t=e(t,i))[0]*l+n,r-t[1]*l]}function N(){A=pe(i=function(t,e,n){return(t%=zt)?e||n?pe(ye(t),_e(e,n)):ye(t):e||n?_e(e,n):de}(g,y,_),e);var t=e(p,d);return n=f-t[0]*l,r=h+t[1]*l,D()}function D(){return u=c=null,I}return I.stream=function(t){return u&&c===t?u:u=He(v(i,C(w(c=t))))},I.clipAngle=function(t){return arguments.length?(v=+t?Qe(m=t*Vt,6*Vt):(m=null,Ue),D()):m*qt},I.clipExtent=function(t){return arguments.length?(w=null==t?(b=o=s=a=null,Te):De(b=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1]),D()):null==b?null:[[b,o],[s,a]]},I.scale=function(t){return arguments.length?(l=+t,N()):l},I.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],N()):[f,h]},I.center=function(t){return arguments.length?(p=t[0]%360*Vt,d=t[1]%360*Vt,N()):[p*qt,d*qt]},I.rotate=function(t){return arguments.length?(g=t[0]%360*Vt,y=t[1]%360*Vt,_=t.length>2?t[2]%360*Vt:0,N()):[g*qt,y*qt,_*qt]},I.precision=function(t){return arguments.length?(C=je(S,E=t*t),D()):$t(E)},I.fitExtent=function(t,e){return Ve(I,t,e)},I.fitSize=function(t,e){return function(t,e,n){return Ve(t,[[0,0],e],n)}(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&x,N()}}(function(){return t})()}function We(t){return function(e,n){var r=Xt(e),i=Xt(n),A=t(r*i);return[A*i*Wt(e),A*Wt(n)]}}function $e(t){return function(e,n){var r=$t(e*e+n*n),i=t(r),A=Wt(i),o=Xt(i);return[Ht(e*A,r*o),Jt(r&&n*A/r)]}}We(function(t){return $t(2/(1+t))}).invert=$e(function(t){return 2*Jt(t/2)});var Ke=We(function(t){return(t=Kt(t))&&t/Wt(t)});function Je(){return Xe(Ke).scale(79.4188).clipAngle(179.999)}function Ze(t,e){return[t,e]}function tn(t,e,n,r){var i=t.properties||{},A="Feature"===t.type?t.geometry:t;if("GeometryCollection"===A.type){var o=[];return Et(t,function(t){var i=tn(t,e,n,r);i&&o.push(i)}),ct(o)}var s=function(t){var e=It(t).geometry.coordinates,n=[-e[0],-e[1]];return Je().rotate(n).scale(At)}(A),a={type:A.type,coordinates:nn(A.coordinates,s)},u=(new Ot.GeoJSONReader).read(a),c=lt(ft(e,n),"meters"),l=Ot.BufferOp.bufferOp(u,c,r);if(!en((l=(new Ot.GeoJSONWriter).write(l)).coordinates))return st({type:l.type,coordinates:rn(l.coordinates,s)},i)}function en(t){return Array.isArray(t[0])?en(t[0]):isNaN(t[0])}function nn(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return nn(t,e)})}function rn(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return rn(t,e)})}Ke.invert=$e(function(t){return t}),Ze.invert=Ze;var An=6378137;function on(t){return function(t,e,n){var r=n;return Et(t,function(t,n,i,A,o){r=e(r,t,n,i,A,o)}),r}(t,function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return sn(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=sn(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},0)}function sn(t){var e=0;if(t&&t.length>0){e+=Math.abs(an(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(an(t[n]))}return e}function an(t){var e,n,r,i,A,o,s=0,a=t.length;if(a>2){for(o=0;o<a;o++)o===a-2?(r=a-2,i=a-1,A=0):o===a-1?(r=a-1,i=0,A=1):(r=o,i=o+1,A=o+2),e=t[r],n=t[i],s+=(un(t[A][0])-un(e[0]))*Math.sin(un(n[1]));s=s*An*An/2}return s}function un(t){return t*Math.PI/180}function cn(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),A=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[n,r];return ut([[o,[i,r],[i,A],[n,A],o]],e.properties,{bbox:t,id:e.id})}const ln={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},fn={halfAnHour:"0.5",oneHour:"1",twoHours:"2",fourHours:"4"},hn={DATA:"/one-layer/v5/{res}/{hexId}"},pn={[O.SMALL]:0,[O.MEDIUM]:1,[O.LARGE]:1,[O.CORRIDOR]:1},dn={[O.SMALL]:2,[O.MEDIUM]:1,[O.LARGE]:2.5,[O.CORRIDOR]:1},gn="polygon",yn="isCorridorMode",_n="isForecastEnabled",mn="aircraftCategory",vn="hoursAgo",bn=({coordinates:t})=>{const e=structuredClone(t);return wn({coordinates:e})},wn=({coordinates:t})=>t.map((e,n)=>{const r=t.at(n-1);return r&&Math.abs(r[0]-e[0])>180?(e[0]-r[0]>180?e[0]-=360:r[0]-e[0]>180&&(e[0]+=360),e):e}),En=({coordinate:t})=>{const[e,n]=t;return[Math.max(-180,Math.min(180,e)),Math.max(-90,Math.min(90,n))]},Cn=({h3Index:t,properties:e})=>(void 0===e&&(e={}),{type:"Feature",id:t,properties:e,geometry:{type:"Polygon",coordinates:[N(t)]}}),In=({squareMeters:t})=>t/1852/1852,xn=({hexagons:t,getProperties:e})=>{const n=[];for(let r=0;r<t.length;r++){const i=t[r],A=e?.(i)||{};n.push(Cn({h3Index:i,properties:A}))}return{type:"FeatureCollection",features:n}},Sn=({hexagons:t=[],scale:e=1})=>{if(!t||!t?.length)return;const n=t.reduce((t,e)=>(t[e.hexId]=e,t),{}),r=xn({hexagons:t.map(({hexId:t})=>t),getProperties:t=>n[t]}).features.map(t=>{const n=Lt(ut(t.geometry.coordinates),e);return{...t,geometry:n.geometry}});return{type:"FeatureCollection",features:r}},Nn=({hexagons:t})=>{if(!Array.isArray(t)||!t.length)return{};const e=new Map;return t.forEach(t=>{const{hexId:n,sev:r,alt:i,observationTime:A}=t,o=e.get(n);!o||o.sev<r?e.set(n,{hexId:n,sev:r,alt:i,observationTime:A,reports:[...o?.reports||[],t]}):e.set(n,{...o,reports:[...o.reports,t]})}),Object.fromEntries(e)},Dn=({coordinate:t})=>t?.reverse(),Ln=({mapBounds:t,resolution:e=0})=>{const n=cn(t).geometry.coordinates.map(t=>t.map(t=>Dn({coordinate:t})));return T(n,e)},Tn=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{historyHours:n=B.HOURS_AGO,minAltitude:r=B.ALT_FROM,maxAltitude:i=B.ALT_TO,minSeverity:A=B.SEVERITY}=e,o=Object.entries(t).map(([t,e])=>[t,e.filter(({alt:t})=>t>=r&&t<=i).filter(({sev:t})=>t>=A).filter(({observationTime:t})=>it().unix()-t<=3600*n)]).filter(([,t])=>t.length>0);return Object.fromEntries(o)},Mn=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{minAltitude:n=B.ALT_FROM,maxAltitude:r=B.ALT_TO,minSeverity:i=B.SEVERITY,hoursAgo:A=B.HOURS_AGO,polygonSize:o=O.SMALL}=e,s=new Set,a=o===O.SMALL,u=it().unix()-3600*Number(A),c=Object.entries(t).map(([t,e])=>{const A=e.filter(({hexId:e,alt:A,sev:o,observationTime:c,sources:l})=>{if(A<n||A>r)return!1;if(o<i)return!1;if(0===o&&!a)return!1;if(!(1===l.length&&0===l[0])&&c<u)return!1;const f=`${L(e,t,5)}-${A}`;return!s.has(f)&&(s.add(f),!0)});return[t,A]}).filter(([,t])=>t.length>0);return Object.fromEntries(c)},On=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap(([t,n])=>Array.isArray(n)?n.map(({hexId:n,...r})=>({hexId:L(n,t,e),...r})):null).filter(Boolean)},Pn={0:700,1:300},Rn=({polygon:t,resolution:e,extensionFactor:n=1})=>{const r=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var A=[];switch(t.type){case"GeometryCollection":return Et(t,function(t){var n=tn(t,e,r,i);n&&A.push(n)}),ct(A);case"FeatureCollection":return wt(t,function(t){var n=tn(t,e,r,i);n&&wt(n,function(t){t&&A.push(t)})}),ct(A)}return tn(t,e,r,i)}(ut([t]),Pn[e]*n,{units:"kilometers"});return r.geometry.coordinates[0]},kn=25e5,Bn=({polygon:t})=>{const e=on(ut([t]));if(In({squareMeters:e})>kn)throw new Error("Corridor area is too large, maximum allowed area is 2500000 nautical miles")},Fn=({polygon:t,precision:e=1})=>{const n=ut([t]);return Number(Math.log2(360/(Ct(n)[2]-Ct(n)[0])).toFixed(e))},Gn=({polygon:t,mapping:e=P})=>{const n=Fn({polygon:t});return Object.entries(e).find(([,t])=>n<=t)[0]},Un=({deg:t})=>t*Math.PI/180,Qn=({rad:t})=>180*t/Math.PI,zn=({bbox:t})=>{const e=6378137,[n,r,i,A]=t,o=Un({deg:n}),s=Un({deg:r}),a=Un({deg:i}),u=Un({deg:A}),c=e*o,l=e*a,f=(e*Math.log(Math.tan(Math.PI/4+s/2))+e*Math.log(Math.tan(Math.PI/4+u/2)))/2,h=(c+l)/2/e,p=2*Math.atan(Math.exp(f/e))-Math.PI/2;return[Qn({rad:h}),Qn({rad:p})]},qn=({polygon:t,resolution:e,extensionFactor:n})=>{const r=Ct(ut([t])),i=cn(Ct(at(zn({bbox:r})))).geometry.coordinates[0];return Rn({polygon:i,resolution:e,extensionFactor:n})};var Vn=Object.freeze({__proto__:null,CORRIDOR_POLYGON_MAX_AREA_NM:kn,HEX_RESOLUTION_BUFFERS:Pn,adjustAntiMeridianCrossing:bn,adjustFeatureCoordinates:({coordinates:t})=>bn({coordinates:t}).map(t=>En({coordinate:t})),clampCoordinates:En,extendPolygonByResolution:Rn,getHexIdsByMapBoundsAndResolution:Ln,getHexIdsByPolygonAndResolution:({polygon:t,resolution:e=0,shouldInvertLatLng:n=!0})=>{const r=t.map(t=>n?Dn({coordinate:t}):t);return T(r,e)},getHexIdsFromMapboxMap:({map:t,resolution:e})=>{if(!t)return;const n=t.getBounds().toArray().flat();return Ln({mapBounds:n,resolution:e})},getHexagonsDataSlice:Tn,getHexagonsFeatureCollection:Sn,getMapPolygon:({map:t})=>{const e=t.getBounds().toArray().flat(),[n,r,i,A]=e;return[[n,A],[n,r],[i,r],[i,A],[n,A]]},getMercatorCenterFromBbox:zn,getMiddleArea:qn,getOneLayerHexagonsDataSlice:Mn,getPolygonSize:Gn,getZoomLevel:Fn,groupByHexIdAndSelectMostSevere:Nn,h3SetToFeatureCollection:xn,h3ToFeature:Cn,invertLatLng:Dn,normalizeAntiMeridian:wn,prepareHexagonsDataForMapHexagons:On,squareMetersToNauticalMiles:In,validateCorridorArea:Bn});const Yn={availableConfigInputs:{aircraftCategory:G,hours:{halfAnHour:"0.5",oneHour:"1",twoHours:"2",threeHours:"3",fourHours:"4"},severity:{smooth:0,light:1,lightModerate:2,moderate:3,moderateSevere:4},maxAltitude:k,minAltitude:R,largePolygonHandlingBehavior:{IGNORE:"ignore",USE_MIDDLE_AREA:"loadMiddleArea",EXCLUDE_SMOOTH_SEVERITY:"excludeSmoothSeverity"}}},jn=[0,1,2,3,4],Hn=Array.from({length:25},(t,e)=>e),Xn={INFO:"/weather/v5/nowcasting/info",DATA:"/weather/v6/nowcasting/{res}/{hexId}"},Wn={INFO:"/weather/v5/gtg/info",DATA:"/weather/v6/gtg/{res}/{hexId}"},$n="polygon",Kn="isCorridorMode",Jn="isEnabled",Zn=({response:t,lastUpdatedAt:e,parentCell:n})=>{const r=[];return(t?.data?.items||[]).forEach(t=>{const{forecast:n,alt:i,sev:A,edr:o,hexIds:s}=t,a=(t=>Array.isArray(t)?t.flatMap(t=>{if("number"==typeof t)return t;if(Array.isArray(t)&&2===t.length){const[e,n]=t;return Number.isInteger(e)&&Number.isInteger(n)&&e<=n?Array.from({length:n-e+1},(t,n)=>e+n):[]}return[]}):[])(s),u=it.unix(e).startOf("hour").add(n,"hour").unix(),c={hexIds:a,forecast:n,alt:i,sev:void 0!==o&&void 0===A?tt({edrValue:o}):A,observationTime:u,edr:o};r.push(c)}),{parentCell:n,reports:r}},tr=({data:t,resolution:e=5})=>t?Object.entries(t).flatMap(([t,n])=>n.flatMap(({hexIds:n,...r})=>n.map(n=>{let i;try{i=L(n,t,e)}catch(r){return console.warn(`[SkyPath SDK]: Hexagon skipped; ${r?.message||"Error while converting hexId to cellHexId"}`,{hexId:n,cell:t,resolution:e}),null}return{hexId:i,...r}})).filter(Boolean)):[],er=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?tr({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=tr({data:t});return Sn({hexagons:e})}}),nr="GET",rr="POST",ir="x-api-key",Ar="x-access-token",or="content-type",sr="/auth/v5/partner/login",ar="/auth/v5/partner/login-signed",ur="/auth/v5/partner/refresh-token",cr="/auth/v5/users/me",lr="[SkyPath SDK]: Old fetch request aborted",fr="local",hr="development",pr="staging",dr="production",gr={[fr]:"https://staging-api.skypath.io",[hr]:"https://dev-api.skypath.io",[pr]:"https://staging-api.skypath.io",[dr]:"https://api.skypath.io"},yr={CHROME:"Failed to fetch",FIREFOX:"NetworkError when attempting to fetch resource.",SAFARI:"Load failed"},_r={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},mr=console,vr={};Object.keys(_r).forEach(t=>{vr[t]=mr[t]});const br="Datadog Browser SDK:",wr={debug:vr.debug.bind(mr,br),log:vr.log.bind(mr,br),info:vr.info.bind(mr,br),warn:vr.warn.bind(mr,br),error:vr.error.bind(mr,br)},Er="https://docs.datadoghq.com",Cr=`${Er}/real_user_monitoring/browser/troubleshooting`,Ir="More details:";function xr(t,e){return(...n)=>{try{return t(...n)}catch(t){wr.error(e,t)}}}function Sr(t){return 0!==t&&100*Math.random()<=t}function Nr(t,e){return Object.keys(t).some(n=>t[n]===e)}function Dr(t){return 0===Object.keys(t).length}function Lr(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}const Tr=Lr(),Mr="WorkerGlobalScope"in Tr;function Or(t,e){const n=Lr();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let Pr,Rr=!1;function kr(t){Rr=t}function Br(t){return function(...e){return Fr(t,this,e)}}function Fr(t,e,n){try{return t.apply(e,n)}catch(t){Gr(t)}}function Gr(t){if(Ur(t),Pr)try{Pr(t)}catch(t){Ur(t)}}function Ur(...t){Rr&&wr.error("[MONITOR]",...t)}function Qr(t,e){return Or(Lr(),"setTimeout")(Br(t),e)}function zr(t){Or(Lr(),"clearTimeout")(t)}function qr(t,e){return Or(Lr(),"setInterval")(Br(t),e)}function Vr(t){Or(Lr(),"clearInterval")(t)}function Yr(t){var e;const n=null===(e=Tr.queueMicrotask)||void 0===e?void 0:e.bind(Tr);"function"==typeof n?n(Br(t)):Promise.resolve().then(Br(t))}class jr{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(e=>e(t))}addObserver(t){this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(e=>t!==e),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function Hr(...t){return new jr(e=>{const n=t.map(t=>t.subscribe(t=>e.notify(t)));return()=>n.forEach(t=>t.unsubscribe())})}class Xr extends jr{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let e=!1;const n={unsubscribe:()=>{e=!0,this.removeObserver(t)}};return Yr(()=>{for(const n of this.buffer){if(e)return;t(n)}e||this.addObserver(t)}),n}unbuffer(){Yr(()=>{this.maxBufferSize=this.buffer.length=0})}}const Wr=1e3,$r=6e4;function Kr(){return(new Date).getTime()}function Jr(){return Kr()}function Zr(){return performance.now()}function ti(){return{relative:Zr(),timeStamp:Jr()}}function ei(t,e){return e-t}let ni;function ri(){var t,e;return void 0===ni&&(ni=null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:performance.timeOrigin),ni}function ii(){}function Ai(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,Ai)}const oi=/([\w-]+)\s*=\s*([^;]+)/g;function si(t,e,n=""){const r=t.charCodeAt(e-1),i=r>=55296&&r<=56319?e+1:e;return t.length<=i?t:`${t.slice(0,i)}${n}`}function ai(){return 0===(null!=ui?ui:ui=function(t=window){var e;const n=t.navigator.userAgent;return t.chrome||/HeadlessChrome/.test(n)?0:0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}())}let ui,ci,li,fi;function hi(t){return pi(t,location.href).href}function pi(t,e){const{URL:n}=function(){if(!ci){let t,e;try{t=document.createElement("iframe"),t.style.display="none",document.body.appendChild(t),e=t.contentWindow}catch(t){e=Tr}ci={URL:e.URL},null==t||t.remove()}return ci}();try{return void 0!==e?new n(t,e):new n(t)}catch(t){throw new Error(`Failed to construct URL: ${String(t)}`)}}function di(t,e,n=0,r){const i=new Date;i.setTime(i.getTime()+n);const A=`expires=${i.toUTCString()}`,o=r&&r.crossSite?"none":"strict",s=r&&r.domain?`;domain=${r.domain}`:"",a=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${A};path=/;samesite=${o}${s}${a}${u}`}function gi(t){return function(t,e){for(oi.lastIndex=0;;){const n=oi.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function yi(t){return function(t){const e=new Map;for(oi.lastIndex=0;;){const n=oi.exec(t);if(!n)break;{const t=n[1],r=n[2];e.has(t)?e.get(t).push(r):e.set(t,[r])}}return e}(document.cookie).get(t)||[]}function _i(t){return li||(li=function(t){const e=new Map;for(oi.lastIndex=0;;){const n=oi.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),li.get(t)}function mi(t,e){di(t,"",0,e)}function vi(t=location.hostname,e=document.referrer){if(void 0===fi){const n=function(t,e){try{return t||pi(e).hostname}catch(t){}}(t,e);if(n){const t=`dd_site_test_${Ai()}`,e="test",r=n.split(".");let i=r.pop();for(;r.length&&!gi(t);)i=`${r.pop()}.${i}`,di(t,e,Wr,{domain:i});mi(t,{domain:i}),fi=i}}return fi}const bi="_dd_s";function wi(t){return Object.values(t)}const Ei=144e5,Ci=9e5,Ii="cookie",xi="local-storage",Si=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Ni(t,e){const n={isExpired:"1"};return e.trackAnonymousUser&&(null==t?void 0:t.anonymousId)&&(n.anonymousId=null==t?void 0:t.anonymousId),n}function Di(t){return Dr(t)}function Li(t){return!Di(t)}function Ti(t){return void 0!==t.isExpired||!((void 0===(e=t).created||Kr()-Number(e.created)<Ei)&&(void 0===e.expire||Kr()<Number(e.expire)));var e}function Mi(t){t.expire=String(Kr()+Ci)}function Oi(t){return(e=t,Object.entries(e)).map(([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`).join("&");var e}function Pi(t){const e={};return function(t){return!!t&&(-1!==t.indexOf("&")||Si.test(t))}(t)&&t.split("&").forEach(t=>{const n=Si.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}}),e}function Ri(t){const e=function(t){const e={};if(e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains){const t=vi();if(!t)return;e.domain=t}return e}(t);return e&&function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${Ai()}`,n="test";di(e,n,$r,t);const r=gi(e)===n;return mi(e,t),r}catch(t){return wr.error(t),!1}}(e)?{type:Ii,cookieOptions:e}:void 0}function ki(t,e){const n={isLockEnabled:ai(),persistSession:n=>Bi(e,t,n,Ci),retrieveSession:()=>Fi(e,t),expireSession:n=>Bi(e,t,Ni(n,t),Ei)};return function(t){if(!_i(bi)){const e=_i("_dd"),n=_i("_dd_r"),r=_i("_dd_l"),i={};e&&(i.id=e),r&&/^[01]$/.test(r)&&(i.logs=r),n&&/^[012]$/.test(n)&&(i.rum=n),Li(i)&&(Mi(i),t.persistSession(i))}}(n),n}function Bi(t,e,n,r){let i=Oi(n);e.betaEncodeCookieOptions&&(i=Oi({...n,...Dr(n)?{}:{c:Gi(t)}})),di(bi,i,e.trackAnonymousUser?31536e6:r,t)}function Fi(t,e){if(e.betaEncodeCookieOptions)return function(t){const e=yi(bi),n=Gi(t);let r;for(const t of e.reverse())if(r=Pi(t),r.c===n)break;return null==r||delete r.c,null!=r?r:{}}(t);return Pi(gi(bi))}function Gi(t){let e=0;return e|=0,e|=(t.domain?t.domain.split(".").length-1:0)<<1,e|=t.crossSite?1:0,e.toString(16)}function Ui(){try{const t=Ai(),e=`_dd_test_${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:xi}:void 0}catch(t){return}}function Qi(t){return{isLockEnabled:!1,persistSession:zi,retrieveSession:qi,expireSession:e=>function(t,e){zi(Ni(t,e))}(e,t)}}function zi(t){localStorage.setItem(bi,Oi(t))}function qi(){return Pi(localStorage.getItem(bi))}const Vi="--",Yi=[];let ji;function Hi(t,e,n=0){var r;const{isLockEnabled:i,persistSession:A,expireSession:o}=e,s=t=>A({...t,lock:u}),a=()=>{const{lock:t,...n}=e.retrieveSession();return{session:n,lock:t&&!$i(t)?t:void 0}};if(ji||(ji=t),t!==ji)return void Yi.push(t);if(i&&n>=100)return void Wi(e);let u,c=a();if(i){if(c.lock)return void Xi(t,e,n);if(u=Ai()+Vi+Jr(),s(c.session),c=a(),c.lock!==u)return void Xi(t,e,n)}let l=t.process(c.session);if(i&&(c=a(),c.lock!==u))Xi(t,e,n);else{if(l&&(Ti(l)?o(l):(Mi(l),i?s(l):A(l))),i&&(!l||!Ti(l))){if(c=a(),c.lock!==u)return void Xi(t,e,n);A(c.session),l=c.session}null===(r=t.after)||void 0===r||r.call(t,l||c.session),Wi(e)}}function Xi(t,e,n){Qr(()=>{Hi(t,e,n+1)},10)}function Wi(t){ji=void 0;const e=Yi.shift();e&&Hi(e,t)}function $i(t){const[,e]=t.split(Vi);return!e||ei(Number(e),Jr())>1e3}const Ki=Wr;function Ji(t){switch(t.sessionPersistence){case Ii:return Ri(t);case xi:return Ui();case void 0:{let e=Ri(t);return!e&&t.allowFallbackToLocalStorage&&(e=Ui()),e}default:wr.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Zi(t,e,n,r,i=function(t,e){return t.type===Ii?ki(e,t.cookieOptions):Qi(e)}(t,e)){const A=new jr,o=new jr,s=new jr,a=qr(function(){const t=i.retrieveSession();Ti(t)?Hi({process:t=>Ti(t)?Ni(t,e):void 0,after:f},i):f(t)},Ki);let u;h();const{throttled:c,cancel:l}=function(t,e){let n,r,i=!1;return{throttled:(...A)=>{i?n=A:(t(...A),i=!0,r=Qr(()=>{n&&t(...n),i=!1,n=void 0},e))},cancel:()=>{zr(r),i=!1,n=void 0}}}(()=>{Hi({process:t=>{if(Di(t))return;const e=f(t);return function(t){if(Di(t))return!1;const e=r(t[n]);t[n]=e,delete t.isExpired,"0"===e||t.id||(t.id=Ai(),t.created=String(Kr()))}(e),e},after:t=>{Li(t)&&!p()&&function(t){u=t,A.notify()}(t),u=t}},i)},Ki);function f(t){return Ti(t)&&(t=Ni(t,e)),p()&&(!function(t){return u.id!==t.id||u[n]!==t[n]}(t)?(s.notify({previousState:u,newState:t}),u=t):(u=Ni(u,e),o.notify())),t}function h(){Hi({process:t=>{if(Di(t))return t.anonymousId=Ai(),Ni(t,e)},after:t=>{u=t}},i)}function p(){return void 0!==(null==u?void 0:u[n])}return{expandOrRenewSession:c,expandSession:function(){Hi({process:t=>p()?f(t):void 0},i)},getSession:()=>u,renewObservable:A,expireObservable:o,sessionStateUpdateObservable:s,restartSession:h,expire:t=>{l(),!1===t&&u&&delete u.anonymousId,i.expireSession(u),f(Ni(u,e))},stop:()=>{Vr(a)},updateSessionState:function(t){Hi({process:e=>({...e,...t}),after:f},i)}}}const tA={GRANTED:"granted",NOT_GRANTED:"not-granted"};function eA(t){return null===t?"null":Array.isArray(t)?"array":typeof t}const nA=["chrome-extension://","moz-extension://"];function rA(t){return nA.some(e=>t.includes(e))}function iA(t,e,n=("undefined"!=typeof location?location.origin:"")){const r=t.allowedTrackingOrigins;if(!r)return!function(t,e=""){return!rA(t)&&rA(e.split("\n").filter(t=>{const e=t.trim();return e.length&&/^at\s+|@/.test(e)})[1]||"")}(n,e)||(wr.error("Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided."),!1);const i=function(t,e,n=!1){return t.some(t=>{try{if("function"==typeof t)return t(e);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?e.startsWith(t):t===e}catch(t){wr.error(t)}return!1})}(r,n);return i||wr.error("SDK initialized on a non-allowed domain."),i}const AA="datad0g.com",oA="dd0g-gov.com",sA="datadoghq.com",aA="pci.browser-intake-datadoghq.com",uA=["ddsource","dd-api-key","dd-request-id"];function cA(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=hi(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const i=function(t,e){const{site:n=sA,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===sA)return aA;if(r&&n===sA)return`${r}.${sA}`;if(n===oA)return`http-intake.logs.${n}`;const i=n.split("."),A=i.pop();return`browser-intake-${i.join("-")}.${A}`}(e,t);return t=>`https://${i}${n}?${t}`}(t,e);return{build(i,A){const o=function({clientToken:t,internalAnalyticsSubdomain:e,source:n="browser"},r,i,{retry:A,encoding:o},s=[]){const a=[`ddsource=${n}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.25.0")}`,"dd-evp-origin=browser",`dd-request-id=${Ai()}`].concat(s);o&&a.push(`dd-evp-encoding=${o}`);"rum"===r&&(a.push(`batch_time=${Jr()}`,`_dd.api=${i}`),A&&a.push(`_dd.retry_count=${A.count}`,`_dd.retry_after=${A.lastFailureStatus}`));e&&a.reverse();return a.join("&")}(t,e,i,A,n);return r(o)},trackType:e}}function lA(t){const e=t.site||sA,n=function(t){if("flutter"===t||"unity"===t)return t;return"browser"}(t.source),r=function(t){return{logsEndpointBuilder:cA(t,"logs"),rumEndpointBuilder:cA(t,"rum"),profilingEndpointBuilder:cA(t,"profile"),sessionReplayEndpointBuilder:cA(t,"replay"),exposuresEndpointBuilder:cA(t,"exposures"),flagEvaluationEndpointBuilder:cA(t,"flagevaluation")}}({...t,site:e,source:n}),i=function(t){if(!t.replica)return;const e={...t,site:sA,clientToken:t.replica.clientToken};return{logsEndpointBuilder:cA(e,"logs"),rumEndpointBuilder:cA(e,"rum",[`application.id=${t.replica.applicationId}`])}}({...t,site:e,source:n});return{replica:i,site:e,source:n,...r}}function fA(t,e){return null==t||"string"==typeof t||(wr.error(`${e} must be defined as a string`),!1)}function hA(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(wr.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function pA(t,e){var n,r,i,A,o,s,a,u,c,l;if(t&&t.clientToken)if(void 0===t.allowedTrackingOrigins||Array.isArray(t.allowedTrackingOrigins)){if((!(f=t.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(wr.error(`Site should be a valid Datadog site. ${Ir} ${Er}/getting_started/site/.`),0))&&hA(t.sessionSampleRate,"Session")&&hA(t.telemetrySampleRate,"Telemetry")&&hA(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&hA(t.telemetryUsageSampleRate,"Telemetry Usage")&&fA(t.version,"Version")&&fA(t.env,"Env")&&fA(t.service,"Service")&&iA(t,null!=e?e:"")){var f;if(void 0===t.trackingConsent||Nr(tA,t.trackingConsent))return{beforeSend:t.beforeSend&&xr(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Mr?void 0:Ji(t),sessionSampleRate:null!==(n=t.sessionSampleRate)&&void 0!==n?n:100,telemetrySampleRate:null!==(r=t.telemetrySampleRate)&&void 0!==r?r:20,telemetryConfigurationSampleRate:null!==(i=t.telemetryConfigurationSampleRate)&&void 0!==i?i:5,telemetryUsageSampleRate:null!==(A=t.telemetryUsageSampleRate)&&void 0!==A?A:5,service:null!==(o=t.service)&&void 0!==o?o:void 0,env:null!==(s=t.env)&&void 0!==s?s:void 0,version:null!==(a=t.version)&&void 0!==a?a:void 0,datacenter:null!==(u=t.datacenter)&&void 0!==u?u:void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(c=t.trackingConsent)&&void 0!==c?c:tA.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,betaEncodeCookieOptions:!!t.betaEncodeCookieOptions,variant:t.variant,sdkVersion:t.sdkVersion,...lA(t)};wr.error('Tracking Consent should be either "granted" or "not-granted"')}}else wr.error("Allowed Tracking Origins must be an array");else wr.error("Client Token is not configured, we will not send any data.")}var dA;!function(t){t.TRACK_INTAKE_REQUESTS="track_intake_requests",t.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",t.FEATURE_OPERATION_VITAL="feature_operation_vital",t.SHORT_SESSION_INVESTIGATION="short_session_investigation",t.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"}(dA||(dA={}));const gA=new Set;function yA(t){Array.isArray(t)&&t.filter(t=>Nr(dA,t)).forEach(t=>{gA.add(t)})}function _A(t){return gA.has(t)}function mA(){return gA}const vA="?";function bA(t){var e,n;const r=[];let i=LA(t,"stack");const A=String(t);if(i&&i.startsWith(A)&&(i=i.slice(A.length)),i&&i.split("\n").forEach(t=>{const e=function(t){const e=CA.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),i=IA.exec(e[2]);r&&i&&(e[2]=i[1],e[3]=i[2],e[4]=i[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||vA,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=xA.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:vA,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=SA.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||vA,line:+e[3],url:e[2]}}(t)||function(t){const e=NA.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=DA.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||vA,line:e[4]?+e[4]:void 0,url:e[3]}}(t);e&&(!e.func&&e.line&&(e.func=vA),r.push(e))}),r.length>0&&function(){if(void 0!==PA)return PA;class t extends Error{constructor(){super(),this.name="Error"}}const[e,n]=[t,Error].map(t=>new t);return PA=OA(Object.getPrototypeOf(e))&&n.stack!==e.stack,PA}()&&t instanceof Error){const i=[];let A=t;for(;(A=Object.getPrototypeOf(A))&&OA(A);){const t=(null===(e=A.constructor)||void 0===e?void 0:e.name)||vA;i.push(t)}for(let t=i.length-1;t>=0&&(null===(n=r[0])||void 0===n?void 0:n.func)===i[t];t--)r.shift()}return{message:LA(t,"message"),name:LA(t,"name"),stack:r}}const wA="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",EA="(?::(\\d+))",CA=new RegExp(`^\\s*at (.*?) ?\\(${wA}${EA}?${EA}?\\)?\\s*$`,"i"),IA=new RegExp(`\\((\\S*)${EA}${EA}\\)`);const xA=new RegExp(`^\\s*at ?${wA}${EA}?${EA}??\\s*$`,"i");const SA=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const NA=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,DA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function LA(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function TA(t,e,n,r){if(void 0===e)return;const{name:i,message:A}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=MA.exec(t));return{name:e,message:n}}(t);return{name:i,message:A,stack:[{url:e,column:r,line:n}]}}const MA=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function OA(t){return String(t.constructor).startsWith("class ")}let PA;function RA(t){const e=new Error(t);let n;return e.name="HandlingStack",Fr(()=>{const t=bA(e);t.stack=t.stack.slice(2),n=kA(t)}),n}function kA(t){let e=BA(t);return t.stack.forEach(t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",i=t.line?`:${t.line}`:"",A=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${i}${A}`}),e}function BA(t){return`${t.name||"Error"}: ${t.message}`}function FA(t,e,n,{computeHandlingStack:r}={}){let i=t[e];if("function"!=typeof i){if(!(e in t)||"string"!=typeof e||!e.startsWith("on"))return{stop:ii};i=ii}let A=!1;const o=function(){if(A)return i.apply(this,arguments);const t=Array.from(arguments);let e;Fr(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?RA("instrumented method"):void 0}]);const o=i.apply(this,t);return e&&Fr(e,null,[o]),o};return t[e]=o,{stop:()=>{A=!0,t[e]===o&&(t[e]=i)}}}const GA=/[^\u0000-\u007F]/;function UA(t){return GA.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function QA(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=zA(Object.prototype),i=zA(Array.prototype),A=zA(Object.getPrototypeOf(t)),o=zA(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),i(),A(),o()}}function zA(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):ii}function qA(t,e=225280){const n=zA(Object.prototype),r=zA(Array.prototype),i=[],A=new WeakMap,o=VA(t,"$",void 0,i,A),s=JSON.stringify(o);let a=s?s.length:0;if(!(a>e)){for(;i.length>0&&a<e;){const n=i.shift();let r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){const s=VA(n.source[o],n.path,o,i,A);if(a+=void 0!==s?JSON.stringify(s).length:4,a+=r,r=1,a>e){jA(e,"truncated",t);break}n.target[o]=s}else for(const o in n.source)if(Object.prototype.hasOwnProperty.call(n.source,o)){const s=VA(n.source[o],n.path,o,i,A);if(void 0!==s&&(a+=JSON.stringify(s).length+r+o.length+3,r=1),a>e){jA(e,"truncated",t);break}n.target[o]=s}}return n(),r(),o}jA(e,"discarded",t)}function VA(t,e,n,r,i){const A=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!A||"object"!=typeof A)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(A);const o=YA(A);if("[Object]"!==o&&"[Array]"!==o&&"[Error]"!==o)return o;const s=t;if(i.has(s))return`[Reference seen at ${i.get(s)}]`;const a=void 0!==n?`${e}.${n}`:e,u=Array.isArray(A)?[]:{};return i.set(s,a),r.push({source:A,target:u,path:a}),u}function YA(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?YA(e.currentTarget):null,target:e.target?YA(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function jA(t,e,n){wr.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const HA="No stack, consider using an instance of Error";function XA({originalError:t,stackTrace:e,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){const A=ZA(t);return!e&&A&&(e=bA(t)),{source:n,type:e?e.name:void 0,message:$A(e,A,i,t),stack:e?kA(e):r?HA:void 0}}function WA({stackTrace:t,originalError:e,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:A,useFallbackStack:o=!0,source:s,handling:a}){return{startClocks:i,handling:a,handlingStack:n,componentStack:r,originalError:e,...XA({originalError:e,stackTrace:t,source:s,useFallbackStack:o,nonErrorPrefix:A}),causes:ZA(e)?to(e,s):void 0,fingerprint:KA(e),context:JA(e)}}function $A(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":n?`${n} ${QA(qA(r))}`:QA(qA(r))}function KA(t){return ZA(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function JA(t){if(null!==t&&"object"==typeof t&&"dd_context"in t)return t.dd_context}function ZA(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function to(t,e){const n=[];let r=t.cause;for(;null!=r&&n.length<10;){const t=XA({originalError:r,source:e,useFallbackStack:!1});n.push(t),r=ZA(r)?r.cause:void 0}return n.length?n:void 0}const eo="agent",no="console",ro="logger",io="network",Ao="source",oo="report";function so(){return new jr(t=>{const e=(e,n)=>{const r=WA({stackTrace:n,originalError:e,startClocks:ti(),nonErrorPrefix:"Uncaught",source:Ao,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,FA(Lr(),"onerror",({parameters:[t,e,n,i,A]})=>{let o;ZA(A)||(o=TA(t,e,n,i)),r(null!=A?A:t,o)}));var r;const{stop:i}=function(t){return FA(Lr(),"onunhandledrejection",({parameters:[e]})=>{t(e.reason||"Empty reason")})}(e);return()=>{n(),i()}})}function ao(t,e){e.silentMultipleInit||wr.error(`${t} is already initialized.`)}function uo(t,e,n,r,i){return co(t,e,[n],r,i)}function co(t,e,n,r,{once:i,capture:A,passive:o}={}){const s=Br(e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(i&&l(),r(e))}),a=o?{capture:A,passive:o}:A,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,c=Or(u,"addEventListener");function l(){const t=Or(u,"removeEventListener");n.forEach(n=>t.call(e,n,s,a))}return n.forEach(t=>c.call(e,t,s,a)),{stop:l}}const lo={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function fo(t,e){const n=[];e.includes(lo.cspViolation)&&n.push(function(t){return new jr(e=>{const{stop:n}=uo(t,document,"securitypolicyviolation",t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return ho({type:t.effectiveDirective,message:`${lo.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:po(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${si(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))});return n})}(t));const r=e.filter(t=>t!==lo.cspViolation);return r.length&&n.push(function(t){return new jr(e=>{if(!window.ReportingObserver)return;const n=Br((t,n)=>t.forEach(t=>e.notify(function(t){const{type:e,body:n}=t;return ho({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:po(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}})}(r)),Hr(...n)}function ho(t){return{startClocks:ti(),source:oo,handling:"unhandled",...t}}function po(t,e,n,r,i){return n?kA({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=i?i:void 0}]}):void 0}function go(t){const{env:e,service:n,version:r,datacenter:i,sdkVersion:A,variant:o}=t,s=[yo("sdk_version",null!=A?A:"6.25.0")];return e&&s.push(yo("env",e)),n&&s.push(yo("service",n)),r&&s.push(yo("version",r)),i&&s.push(yo("datacenter",i)),o&&s.push(yo("variant",o)),s}function yo(t,e){const n=e?`${t}:${e}`:t;return(n.length>200||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(n))&&wr.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${Ir} ${Er}/getting_started/tagging/#defining-tags`),_o(n)}function _o(t){return t.replace(/,/g,"_")}function mo(t,e){const n=Tr.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function vo(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=vo(r[t],e[t],n);return r}const r="object"===eA(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=vo(r[t],e[t],n));return r}function bo(t){return vo(void 0,t)}function wo(...t){let e;for(const n of t)null!=n&&(e=vo(e,n));return e}function Eo(){var t;const e=Tr.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function Co(t){return t>=500}const Io=20971520,xo=Wr;function So(t,e,n,r,i,A){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Do(t,e,n,A,{onSuccess:()=>Lo(0,e,n,r,i,A),onFailure:()=>{e.queuedPayloads.enqueue(t)||A.notify({type:"queue-full",bandwidth:e.bandwidthMonitor.stats(),payload:t}),No(e,n,r,i,A)}}):e.queuedPayloads.enqueue(t)||A.notify({type:"queue-full",bandwidth:e.bandwidthMonitor.stats(),payload:t})}function No(t,e,n,r,i){2===t.transportStatus&&Qr(()=>{Do(t.queuedPayloads.first(),t,e,i,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=xo,Lo(1,t,e,n,r,i)},onFailure:()=>{t.currentBackoffTime=Math.min(6e4,2*t.currentBackoffTime),No(t,e,n,r,i)}})},t.currentBackoffTime)}function Do(t,e,n,r,{onSuccess:i,onFailure:A}){e.bandwidthMonitor.add(t),n(t,n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||Co(t.status))}(n)?(e.transportStatus=0,r.notify({type:"success",bandwidth:e.bandwidthMonitor.stats(),payload:t}),i()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},r.notify({type:"failure",bandwidth:e.bandwidthMonitor.stats(),payload:t}),A())})}function Lo(t,e,n,r,i,A){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: 20MiB`,source:eo,startClocks:ti()}),e.queueFullReported=!0);const o=e.queuedPayloads;for(e.queuedPayloads=To();o.size()>0;)So(o.dequeue(),e,n,r,i,A)}function To(){const t=[];return{bytesCount:0,enqueue(e){return!this.isFull()&&(t.push(e),this.bytesCount+=e.bytesCount,!0)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=Io}}}const Mo=16384;function Oo(t,e,n=16384){const r=new jr,i={transportStatus:0,currentBackoffTime:xo,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=81920&&this.ongoingRequestCount<32},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}},queuedPayloads:To(),queueFullReported:!1};return{observable:r,send:A=>{for(const o of t)So(A,i,(t,e)=>{_A(dA.AVOID_FETCH_KEEPALIVE)?Bo(o,t,e):ko(o,n,t,e)},o.trackType,e,r)},sendOnExit:e=>{for(const r of t)Po(r,n,e)}}}function Po(t,e,n){if(!!navigator.sendBeacon&&n.bytesCount<e)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Ro||(Ro=!0,Gr(t))}(t)}Bo(t,n)}let Ro=!1;function ko(t,e,n,r){if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e){const e=t.build("fetch-keepalive",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(Br(t=>null==r?void 0:r({status:t.status,type:t.type}))).catch(Br(()=>Bo(t,n,r)))}else Bo(t,n,r)}function Bo(t,e,n){const r=t.build("fetch",e);fetch(r,{method:"POST",body:e.data,mode:"cors"}).then(Br(t=>null==n?void 0:n({status:t.status,type:t.type}))).catch(Br(()=>null==n?void 0:n({status:0})))}function Fo(){const t=Lr().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const i=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:i}))}}}function Go(t){var e;void 0===t&&(t=null===(e=Lr().location)||void 0===e?void 0:e.hostname);const n=Fo();return!!n&&n.getAllowedWebViewHosts().some(e=>t===e||t.endsWith(`.${e}`))}const Uo={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};const Qo=262144;function zo({encoder:t,request:e,flushController:n}){let r={};const i=n.flushObservable.subscribe(n=>function(n){const i=wi(r).join("\n");r={};const A=(s=n.reason,wi(Uo).includes(s)),o=A?e.sendOnExit:e.send;var s;if(A&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&o(qo(e));const n=[e.pendingData,i].filter(Boolean).join("\n");n&&o({data:n,bytesCount:UA(n)})}else i&&t.write(t.isEmpty?i:`\n${i}`),t.finish(t=>{o(qo(t))})}(n));function A(e,i){const A=QA(e),o=t.estimateEncodedBytesCount(A);o>=Qo?wr.warn(`Discarded a message whose size was bigger than the maximum allowed size 256KiB. ${Ir} ${Cr}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==r[t]}(i)&&function(e){const i=r[e];delete r[e];const A=t.estimateEncodedBytesCount(i);n.notifyAfterRemoveMessage(A)}(i),function(e,i,A){n.notifyBeforeAddMessage(i),void 0!==A?(r[A]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,t=>{n.notifyAfterAddMessage(t-i)})}(A,o,i))}return{flushController:n,add:A,upsert:A,stop:i.unsubscribe}}function qo(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}const Vo=Mr?1:50;function Yo({pageMayExitObservable:t,sessionExpireObservable:e}){const n=t.subscribe(t=>a(t.reason)),r=e.subscribe(()=>a("session_expire")),i=new jr(()=>()=>{n.unsubscribe(),r.unsubscribe()});let A,o=0,s=0;function a(t){if(0===s)return;const e=s,n=o;s=0,o=0,u(),i.notify({reason:t,messagesCount:e,bytesCount:n})}function u(){zr(A),A=void 0}return{flushObservable:i,get messagesCount(){return s},notifyBeforeAddMessage(t){o+t>=Mo&&a("bytes_limit"),s+=1,o+=t,void 0===A&&(A=Qr(()=>{a("duration_limit")},3e4))},notifyAfterAddMessage(t=0){o+=t,s>=Vo?a("messages_limit"):o>=Mo&&a("bytes_limit")},notifyAfterRemoveMessage(t){o-=t,s-=1,0===s&&u()}}}const jo="DISCARDED",Ho="SKIPPED";const Xo="log",Wo="configuration",$o="usage",Ko=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Jo=["ddog-gov.com"];let Zo;function ts(){return Zo||(Zo=new Xr(100)),Zo}function es(t,e,n,r,i,A){const o=new jr,{stop:s}=function(t,e,n,r,i){const A=[];if(Go()){const t=Fo(),e=i.subscribe(e=>t.send("internal_telemetry",e));A.push(e.unsubscribe)}else{const o=[t.rumEndpointBuilder];t.replica&&function(t){return t.site===AA}(t)&&o.push(t.replica.rumEndpointBuilder);const s=zo({encoder:r(4),request:Oo(o,e),flushController:Yo({pageMayExitObservable:n,sessionExpireObservable:new jr})});A.push(s.stop);const a=i.subscribe(s.add);A.push(a.unsubscribe)}return{stop:()=>A.forEach(t=>t())}}(e,r,i,A,o),{enabled:a,metricsEnabled:u}=function(t,e,n,r,i=1,A=15){const o={},s=!Jo.includes(e.site)&&Sr(e.telemetrySampleRate),a={[Xo]:s,[Wo]:s&&Sr(e.telemetryConfigurationSampleRate),[$o]:s&&Sr(e.telemetryUsageSampleRate),metric:s&&Sr(i)},u={is_local_file:"file:"===(null===(l=Tr.location)||void 0===l?void 0:l.protocol),is_worker:Mr},c=ts();var l;return c.subscribe(({rawEvent:e,metricName:i})=>{if(i&&!a.metric||!a[e.type])return;const s=i||e.status||e.type;let c=o[s];if(c||(c=o[s]=new Set),c.size>=A)return;const l=QA(e);if(c.has(l))return;const h=n.triggerHook(1,{startTime:ti().relative});if(h===jo)return;const p=f(h,t,e,u);r.notify(p),mo("telemetry",p),c.add(l)}),c.unbuffer(),function(t){Pr=t}(rs),{enabled:s,metricsEnabled:a.metric};function f(t,n,r,i){const A={type:"telemetry",date:ti().timeStamp,service:n,version:"6.25.0",source:"browser",_dd:{format_version:2},telemetry:wo(r,{runtime_env:i,connectivity:Eo(),sdk_setup:"npm"}),ddtags:go(e).join(","),experimental_features:Array.from(mA())};return wo(A,t)}}(t,e,n,o);return{stop:s,enabled:a,metricsEnabled:u}}function ns(t,e){Ur(_r.debug,t,e),ts().notify({rawEvent:{type:Xo,message:t,status:"debug",...e}})}function rs(t,e){ts().notify({rawEvent:{type:Xo,status:"error",...is(t),...e}})}function is(t){if(ZA(t)){const e=bA(t);return{error:{kind:e.name,stack:kA(As(e))},message:e.message}}return{error:{stack:HA},message:`Uncaught ${QA(t)}`}}function As(t){return t.stack=t.stack.filter(t=>!t.url||Ko.some(e=>t.url.startsWith(e))),t}function os(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const ss=1/0;let as=null;const us=new Set;function cs({expireDelay:t,maxEntries:e}){let n=[];as||(as=qr(()=>{us.forEach(t=>t())},6e4));const r=()=>{const e=Zr()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()};return us.add(r),{add:function(t,r){const i={value:t,startTime:r,endTime:ss,remove:()=>{os(n,i)},close:t=>{i.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(i),i},find:function(t=Infinity,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===ss&&e.close(t)},findAll:function(t=Infinity,e=0){const r=t+e;return n.filter(e=>e.startTime<=r&&t<=e.endTime).map(t=>t.value)},reset:function(){n=[]},stop:function(){us.delete(r),0===us.size&&as&&(Vr(as),as=null)}}}function ls(){return!Mr&&Boolean(Tr._DATADOG_SYNTHETICS_INJECTS_RUM||_i("datadog-synthetics-injects-rum"))}function fs(){return Boolean(function(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||_i("datadog-synthetics-public-id");return"string"==typeof t?t:void 0}()&&function(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||_i("datadog-synthetics-result-id");return"string"==typeof t?t:void 0}())}const hs=$r,ps=Ei;function ds(t,e,n,r){const i=new jr,A=new jr,o=Zi(t.sessionStoreStrategyType,t,e,n),s=cs({expireDelay:ps});if(o.renewObservable.subscribe(()=>{s.add(a(),Zr()),i.notify()}),o.expireObservable.subscribe(()=>{A.notify(),s.closeActive(Zr())}),o.expandOrRenewSession(),s.add(a(),[0,ri()][0]),_A(dA.SHORT_SESSION_INVESTIGATION)){const e=o.getSession();e&&function(t,e){if(!window.cookieStore||!e.created)return;const n=Number(e.created),r=Kr(),{stop:i}=uo(t,cookieStore,"change",A);function A(t){const A=function(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(e(r,n,t))return r}}(t.changed,t=>t.name===bi);if(!A)return;const o=Kr()-n;if(o>84e4)i();else{const t=Pi(A.value);if(t.id&&t.id!==e.id){i();const n=Kr()-r;gs().then(r=>{ns("Session cookie changed",{time:n,session_age:o,old:e,new:t,cookie:r})}).catch(Gr)}}}}(t,e)}function a(){const n=o.getSession();return n?{id:n.id,trackingType:n[e],isReplayForced:!!n.forcedReplay,anonymousId:n.anonymousId}:(async function(t){const e=t.sessionStoreStrategyType;if(!e)return;let n,r;e.type===Ii?(n=Fi(e.cookieOptions,t),r={cookie:await gs(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=qi();ns("Unexpected session state",{sessionStoreStrategyType:e.type,session:n,isSyntheticsTest:fs(),createdTimestamp:null==n?void 0:n.created,expireTimestamp:null==n?void 0:n.expire,...r})}(t).catch(()=>{}),{id:"invalid",trackingType:"0",isReplayForced:!1,anonymousId:void 0})}return r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire(!1)}),function(t,e){const{stop:n}=co(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,()=>{r.isGranted()&&o.expandOrRenewSession()}),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=uo(t,document,"visibilitychange",n);qr(n,hs)}(t,()=>o.expandSession()),function(t,e){const{stop:n}=uo(t,window,"resume",e,{capture:!0})}(t,()=>o.restartSession()),{findSession:(t,e)=>s.find(t,e),renewObservable:i,expireObservable:A,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}async function gs(){let t;return t="cookieStore"in window?await window.cookieStore.getAll(bi):document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(bi)),{count:t.length,domain:vi()||"undefined",...t}}function ys(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const i=UA(n);e+=i,t+=n,r&&r(i)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}let _s;const ms=new WeakMap;function vs(t){return _s||(_s=function(t){return new jr(e=>{const{stop:n}=FA(XMLHttpRequest.prototype,"open",bs),{stop:r}=FA(XMLHttpRequest.prototype,"send",n=>{!function({target:t,parameters:[e],handlingStack:n},r,i){const A=ms.get(t);if(!A)return;const o=A;o.state="start",o.startClocks=ti(),o.isAborted=!1,o.xhr=t,o.handlingStack=n,o.requestBody=e;let s=!1;const{stop:a}=FA(t,"onreadystatechange",()=>{t.readyState===XMLHttpRequest.DONE&&u()}),u=()=>{if(c(),a(),s)return;s=!0;const e=A;var n;e.state="complete",e.duration=ei(o.startClocks.timeStamp,Jr()),e.status=t.status,"string"==typeof t.response&&(e.responseBody=t.response),i.notify((n=e,{...n}))},{stop:c}=uo(r,t,"loadend",u);i.notify(o)}(n,t,e)},{computeHandlingStack:!0}),{stop:i}=FA(XMLHttpRequest.prototype,"abort",ws);return()=>{n(),r(),i()}})}(t)),_s}function bs({target:t,parameters:[e,n]}){ms.set(t,{state:"open",method:String(e).toUpperCase(),url:hi(String(n))})}function ws({target:t}){const e=ms.get(t);e&&(e.isAborted=!0)}async function Es(t,e){const n=t.getReader(),r=[];for(;;){const t=await n.read();if(t.done)break;e.collectStreamBody&&r.push(t.value)}return n.cancel().catch(ii),e.collectStreamBody?function(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(r):void 0}let Cs;const Is=[];function xs({responseBodyAction:t}={}){return t&&Is.push(t),Cs||(Cs=new jr(t=>{if(!Tr.fetch)return;const{stop:e}=FA(Tr,"fetch",e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[i,A]=t;let o=A&&A.method;void 0===o&&i instanceof Request&&(o=i.method);const s=void 0!==o?String(o).toUpperCase():"GET",a=i instanceof Request?i.url:hi(String(i)),u=ti(),c={state:"start",init:A,input:i,method:s,startClocks:u,url:a,handlingStack:n};r.notify(c),t[0]=c.input,t[1]=c.init,e(t=>{(async function(t,e,n){var r,i;const A=n;let o;A.state="resolve";try{o=await e}catch(e){return A.status=0,A.isAborted=(null===(i=null===(r=A.init)||void 0===r?void 0:r.signal)||void 0===i?void 0:i.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,A.error=e,void t.notify(A)}A.response=o,A.status=o.status,A.responseType=o.type,A.isAborted=!1;const s=Is.reduce((t,e)=>Math.max(t,e(A)),0);if(0!==s){const t=function(t){try{return t.clone()}catch(t){return}}(o);if(t&&t.body)try{const e=await Es(t.body,{collectStreamBody:2===s});A.responseBody=e&&(new TextDecoder).decode(e)}catch(t){}}t.notify(A)})(r,t,c).catch(Gr)})}(e,t),{computeHandlingStack:!0});return e})),Cs}let Ss={};function Ns(t){return Hr(...t.map(t=>(Ss[t]||(Ss[t]=function(t){return new jr(e=>{const n=mr[t];return mr[t]=(...r)=>{n.apply(console,r);const i=RA("console error");Fr(()=>{e.notify(function(t,e,n){const r=t.map(t=>function(t){if("string"==typeof t)return qA(t);if(ZA(t))return BA(bA(t));return QA(qA(t),void 0,2)}(t)).join(" ");if(e===_r.error){const i=WA({originalError:t.find(ZA),handlingStack:n,startClocks:ti(),source:no,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=r,{api:e,message:r,handlingStack:n,error:i}}return{api:e,message:r,error:void 0,handlingStack:n}}(r,t,i))})},()=>{mr[t]=n}})}(t)),Ss[t])))}function Ds(t,e,n){const r={...t};for(const[t,{required:i,type:A}]of Object.entries(e))"string"!==A||Ls(r[t])||(r[t]=String(r[t])),i&&Ls(r[t])&&wr.warn(`The property ${t} of ${n} is required; context will not be sent to the intake.`);return r}function Ls(t){return null==t||""===t}function Ts(t="",{propertiesConfig:e={}}={}){let n={};const r=new jr,i={getContext:()=>bo(n),setContext:A=>{!function(t){const e="object"===eA(t);return e||wr.error("Unsupported context:",t),e}(A)?i.clearContext():n=qA(Ds(A,e,t)),r.notify()},setContextProperty:(i,A)=>{n=qA(Ds({...n,[i]:A},e,t)),r.notify()},removeContextProperty:i=>{delete n[i],Ds(n,e,t),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Ms(t,e,n,r){return Br((...r)=>t()[e][n](...r))}function Os(t,e,n){t.changeObservable.subscribe(()=>{const r=t.getContext();n.add(t=>t[e].setContext(r))})}const Ps="_dd_c",Rs=[];function ks(t,e,n,r){const i=function(t,e){return`${Ps}_${t}_${e}`}(n,r);Rs.push(uo(t,window,"storage",({key:t})=>{i===t&&e.setContext(o())})),e.changeObservable.subscribe(function(){localStorage.setItem(i,JSON.stringify(e.getContext()))});const A=wo(o(),e.getContext());function o(){const t=localStorage.getItem(i);return t?JSON.parse(t):{}}Dr(A)||e.setContext(A)}function Bs(){return Ts("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Fs(){return Ts("global context")}function Gs(){return Ts("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Us="userContext",Qs="globalContext",zs="accountContext",qs="getContext",Vs="setContext",Ys="setContextProperty",js="removeContextProperty",Hs="clearContext",Xs={FETCH:"fetch",XHR:"xhr"};function Ws(t,e,n){const r=n.getHandler(),i=Array.isArray(r)?r:[r];return Ks[t]>=Ks[n.getLevel()]&&i.includes(e)}const $s={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},Ks={[$s.ok]:0,[$s.debug]:1,[$s.info]:2,[$s.notice]:4,[$s.warn]:5,[$s.error]:6,[$s.critical]:7,[$s.alert]:8,[$s.emerg]:9};function Js(t,{includeMessage:e=!1}={}){return{stack:t.stack,kind:t.type,message:e?t.message:void 0,causes:t.causes,fingerprint:t.fingerprint,handling:t.handling}}var Zs=function(t,e,n,r){var i,A=arguments.length,o=A<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(A<3?i(o):A>3?i(e,n,o):i(e,n))||o);return A>3&&o&&Object.defineProperty(e,n,o),o};const ta="console",ea="http",na=Object.keys($s);class ra{constructor(t,e,n=ea,r=$s.debug,i={}){this.handleLogStrategy=t,this.handlerType=n,this.level=r,this.contextManager=Ts("logger"),this.tags=[],this.contextManager.setContext(i),e&&this.contextManager.setContextProperty("logger",{name:e})}logImplementation(t,e,n=$s.info,r,i){const A=qA(e);let o;if(null!=r){const t=WA({originalError:r,nonErrorPrefix:"Provided",source:ro,handling:"handled",startClocks:ti()});o=wo({error:Js(t,{includeMessage:!0})},t.context,A)}else o=A;this.handleLogStrategy({message:qA(t),context:o,status:n},this,i)}log(t,e,n=$s.info,r){let i;Ws(n,ea,this)&&(i=RA("log")),this.logImplementation(t,e,n,r,i)}setContext(t){this.contextManager.setContext(t)}getContext(){return this.contextManager.getContext()}setContextProperty(t,e){this.contextManager.setContextProperty(t,e)}removeContextProperty(t){this.contextManager.removeContextProperty(t)}clearContext(){this.contextManager.clearContext()}addTag(t,e){this.tags.push(yo(t,e))}removeTagsWithKey(t){const e=_o(t);this.tags=this.tags.filter(t=>t!==e&&!t.startsWith(`${e}:`))}getTags(){return this.tags.slice()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function ia(t){return function(e,n,r){let i;Ws(t,ea,this)&&(i=RA("log")),this.logImplementation(e,n,t,r,i)}}function Aa(){return Mr?{}:{view:{referrer:document.referrer,url:window.location.href}}}Zs([function(t,e,n){const r=n.value;n.value=function(...t){return(Pr?Br(r):r).apply(this,t)}}],ra.prototype,"logImplementation",null),ra.prototype.ok=ia($s.ok),ra.prototype.debug=ia($s.debug),ra.prototype.info=ia($s.info),ra.prototype.notice=ia($s.notice),ra.prototype.warn=ia($s.warn),ra.prototype.error=ia($s.error),ra.prototype.critical=ia($s.critical),ra.prototype.alert=ia($s.alert),ra.prototype.emerg=ia($s.emerg);function oa(t,e,n){return void 0===t?[]:"all"===t||Array.isArray(t)&&t.every(t=>e.includes(t))?"all"===t?e:function(t){const e=new Set;return t.forEach(t=>e.add(t)),Array.from(e)}(t):void wr.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function sa(t){const e={session_sample_rate:(n=t).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent,use_allowed_tracking_origins:Array.isArray(n.allowedTrackingOrigins),beta_encode_cookie_options:n.betaEncodeCookieOptions,source:n.source,sdk_version:n.sdkVersion,variant:n.variant};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}function aa(t,e,n){const r=function(){const t=[];return{add:e=>{t.push(e)>500&&t.splice(0,1)},remove:e=>{os(t,e)},drain:e=>{t.forEach(t=>t(e)),t.length=0}}}(),i=Fs();Os(i,Qs,r);const A=Bs();Os(A,zs,r);const o=Gs();let s,a;Os(o,Us,r);const u=e.observable.subscribe(c);function c(){if(!a||!s||!e.isGranted())return;u.unsubscribe();const t=n(s,a);r.drain(t)}return{init(t,n){if(!t)return void wr.error("Missing configuration");if(yA(t.enableExperimentalFeatures),Go()&&(t=function(t){return{...t,clientToken:"empty"}}(t)),s=t,function(t){ts().notify({rawEvent:{type:Wo,configuration:t}})}(sa(t)),a)return void ao("DD_LOGS",t);const r=function(t,e){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&wr.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=pA(t,e),r=oa(t.forwardConsoleLogs,wi(_r),"Forward Console Logs"),i=oa(t.forwardReports,wi(lo),"Forward Reports");if(n&&r&&i)return t.forwardErrorsToLogs&&!r.includes(_r.error)&&r.push(_r.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:32768,...n}}(t,n);r&&(a=r,xs().subscribe(ii),e.tryToInit(r.trackingConsent),c())},get initConfiguration(){return s},globalContext:i,accountContext:A,userContext:o,getInternalContext:ii,handleLog(e,n,i,A=t(),o=Jr()){r.add(t=>t.handleLog(e,n,i,A,o))}}}function ua(t,e){return"0"===(n=e)||"1"===n?e:Sr(t.sessionSampleRate)?"1":"0";var n}function ca(t,e,n,r,i,A){const o=na.concat(["custom"]),s={};o.forEach(t=>{s[t]=function(t,e,n=3e3){let r=0,i=!1;return{isLimitReached(){if(0===r&&Qr(()=>{r=0},$r),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{e({message:`Reached max number of ${t}s by minute: ${n}`,source:eo,startClocks:ti()})}finally{i=!1}}return!0}}}(t,i,A)}),e.subscribe(0,({rawLogsEvent:i,messageContext:A,savedCommonContext:o,domainContext:a,ddtags:u=[]})=>{var c,l;const f=i.date-ri();const h=o||r(),p=n.triggerHook(0,{startTime:f});if(p===jo)return;const d=go(t),g=wo({view:h.view},p,i,A,{ddtags:d.concat(u).join(",")});!1===(null===(c=t.beforeSend)||void 0===c?void 0:c.call(t,g,a))||g.origin!==eo&&(null!==(l=s[g.status])&&void 0!==l?l:s.custom).isLimitReached()||e.notify(1,g)})}const la={[_r.log]:$s.info,[_r.debug]:$s.debug,[_r.info]:$s.info,[_r.warn]:$s.warn,[_r.error]:$s.error};function fa(t,e){if(!t.forwardErrorsToLogs)return{stop:ii};const n=(Mr?new jr:vs(t)).subscribe(t=>{"complete"===t.state&&A(Xs.XHR,t)}),r=xs({responseBodyAction:t=>i(t)?2:0}).subscribe(t=>{"resolve"===t.state&&A(Xs.FETCH,t)});function i(t){return e=t.url,!uA.every(t=>e.includes(t))&&(function(t){return 0===t.status&&"opaque"!==t.responseType}(t)||Co(t.status));var e}function A(n,r){if(!i(r))return;const A="error"in r&&r.error?kA(bA(r.error)):r.responseBody||"Failed to load",o={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${ha(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:si(A,t.requestErrorResponseLengthLimit,"..."),handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:$s.error,origin:io},domainContext:o})}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function ha(t){return Xs.XHR===t?"XHR":"Fetch"}const pa=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach(t=>t(e))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(t=>e!==t)}}}};function da(t){return{handleLog:function(e,n,r,i,A){const o=wo(n.getContext(),e.context);if(Ws(e.status,ta,n)&&function({status:t,message:e},n){vr[ga[t]].call(mr,e,n)}(e,o),Ws(e.status,ea,n)){const s={rawLogsEvent:{date:A||Jr(),message:e.message,status:e.status,origin:ro},messageContext:o,savedCommonContext:i,ddtags:n.getTags()};r&&(s.domainContext={handlingStack:r}),t.notify(0,s)}}}}const ga={[$s.ok]:_r.debug,[$s.debug]:_r.debug,[$s.info]:_r.info,[$s.notice]:_r.info,[$s.warn]:_r.warn,[$s.error]:_r.error,[$s.critical]:_r.error,[$s.alert]:_r.error,[$s.emerg]:_r.error};const ya=function(){const t={};return{register:(e,n)=>(t[e]||(t[e]=[]),t[e].push(n),{unregister:()=>{t[e]=t[e].filter(t=>t!==n)}}),triggerHook(e,n){const r=t[e]||[],i=[];for(const t of r){const e=t(n);if(e===jo)return jo;e!==Ho&&i.push(e)}return wo(...i)}}};const _a="logs";const ma=function(t){const e=function(t){const e=new jr;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===tA.GRANTED,observable:e}}(),n=function(t=so){const e=new Xr(500),n=t().subscribe(t=>{e.notify({type:0,error:t})});return{observable:e,stop:()=>{n.unsubscribe()}}}().observable;let r=aa(Aa,e,(i,A)=>{const o=t(A,Aa,e,n);return r=function(t,e){return{init:t=>{ao("DD_LOGS",t)},initConfiguration:t,...e}}(i,o),o});const i=()=>r,A={};return function(t){const e={version:"6.25.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>kr,enumerable:!1}),e}({logger:new ra((...t)=>r.handleLog(...t)),init:t=>{const e=(new Error).stack;Fr(()=>r.init(t,e))},setTrackingConsent:Br(t=>{var n;e.update(t),n={feature:"set-tracking-consent",tracking_consent:t},ts().notify({rawEvent:{type:$o,usage:n}})}),getGlobalContext:Ms(i,Qs,qs),setGlobalContext:Ms(i,Qs,Vs),setGlobalContextProperty:Ms(i,Qs,Ys),removeGlobalContextProperty:Ms(i,Qs,js),clearGlobalContext:Ms(i,Qs,Hs),createLogger:Br((t,e={})=>(A[t]=new ra((...t)=>r.handleLog(...t),qA(t),e.handler,e.level,qA(e.context)),A[t])),getLogger:Br(t=>A[t]),getInitConfiguration:Br(()=>bo(r.initConfiguration)),getInternalContext:Br(t=>r.getInternalContext(t)),setUser:Ms(i,Us,Vs),getUser:Ms(i,Us,qs),setUserProperty:Ms(i,Us,Ys),removeUserProperty:Ms(i,Us,js),clearUser:Ms(i,Us,Hs),setAccount:Ms(i,zs,Vs),getAccount:Ms(i,zs,qs),setAccountProperty:Ms(i,zs,Ys),removeAccountProperty:Ms(i,zs,js),clearAccount:Ms(i,zs,Hs)})}(function(t,e,n,r){const i=new pa,A=ya(),o=[];i.subscribe(1,t=>mo("logs",t));const s=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:eo,status:$s.error}}),ns("Error reported to customer",{"error.message":e.message})}}(i),a=Mr?new jr:function(t){return new jr(e=>{const{stop:n}=co(t,window,["visibilitychange","freeze"],t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Uo.HIDDEN}):"freeze"===t.type&&e.notify({reason:Uo.FROZEN})},{capture:!0}),r=uo(t,window,"beforeunload",()=>{e.notify({reason:Uo.UNLOADING})}).stop;return()=>{n(),r()}})}(t),u=es("browser-logs-sdk",t,A,s,a,ys);o.push(u.stop);const c=!t.sessionStoreStrategyType||Go()||ls()?function(t){const e="1"===ua(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new jr}}(t):function(t,e){const n=ds(t,"logs",e=>ua(t,e),e);return{findTrackedSession:(t,e={returnInactive:!1})=>{const r=n.findSession(t,e);return r&&"1"===r.trackingType?{id:r.id,anonymousId:r.anonymousId}:void 0},expireObservable:n.expireObservable}}(t,n);!function(t,e){function n(){return e.isGranted()?Ho:jo}t.register(0,n),t.register(1,n)}(A,n),function(t,e,n){t.register(0,({startTime:t})=>{const r=n.findTrackedSession(t);return n.findTrackedSession(t,{returnInactive:!0})?{service:e.service,session_id:r?r.id:void 0,session:r?{id:r.id}:void 0}:jo}),t.register(1,({startTime:t})=>{const e=n.findTrackedSession(t);return e&&e.id?{session:{id:e.id}}:Ho})}(A,t,c);const l=function(t,e,n){const r=Bs();return e.storeContextsAcrossPages&&ks(e,r,n,4),t.register(0,()=>{const t=r.getContext();return Dr(t)||!t.id?Ho:{account:t}}),r}(A,t,_a),f=function(t,e,n,r){const i=Gs();return e.storeContextsAcrossPages&&ks(e,i,r,1),t.register(0,({eventType:t,startTime:r})=>{const A=i.getContext(),o=n.findTrackedSession(r);return o&&o.anonymousId&&!A.anonymous_id&&e.trackAnonymousUser&&(A.anonymous_id=o.anonymousId),Dr(A)?Ho:{type:t,usr:A}}),t.register(1,({startTime:t})=>{var e;return{anonymous_id:null===(e=n.findTrackedSession(t))||void 0===e?void 0:e.anonymousId}}),i}(A,t,c,_a),h=function(t,e,n){const r=Fs();return e.storeContextsAcrossPages&&ks(e,r,n,2),t.register(0,()=>r.getContext()),r}(A,t,_a);!function(t){const e=Tr;function n(t){const n=function(t,e){if(e&&e.getInternalContext)return e.getInternalContext(t)}(t,ls()?e.DD_RUM_SYNTHETICS:e.DD_RUM);if(n)return n}t.register(0,({startTime:t})=>n(t)||Ho),t.register(1,({startTime:t})=>{var e,r;const i=n(t);return i?{application:{id:i.application_id},view:{id:null===(e=i.view)||void 0===e?void 0:e.id},action:{id:null===(r=i.user_action)||void 0===r?void 0:r.id}}:Ho})}(A),fa(t,i),function(t,e,n){if(!t.forwardErrorsToLogs)return{stop:ii};const r=n.subscribe(t=>{if(0===t.type){const n=t.error;e.notify(0,{rawLogsEvent:{message:n.message,date:n.startClocks.timeStamp,error:Js(n),origin:Ao,status:$s.error},messageContext:n.context})}})}(t,i,r),r.unbuffer(),function(t,e){const n=Ns(t.forwardConsoleLogs).subscribe(t=>{var n;const r={rawLogsEvent:{date:Jr(),message:t.message,origin:no,error:t.error&&Js(t.error),status:la[t.api]},messageContext:null===(n=t.error)||void 0===n?void 0:n.context,domainContext:{handlingStack:t.handlingStack}};e.notify(0,r)})}(t,i),function(t,e){const n=fo(t,t.forwardReports).subscribe(t=>{let n,r=t.message;const i="deprecation"===t.originalError.type?$s.warn:$s.error;var A,o;i===$s.error?n=Js(t):t.stack&&(r+=` Found in ${A=t.stack,null===(o=/@ (.+)/.exec(A))||void 0===o?void 0:o[1]}`),e.notify(0,{rawLogsEvent:{date:Jr(),message:r,origin:oo,error:n,status:i}})})}(t,i);const{handleLog:p}=da(i);if(ca(t,i,A,e,s),Go())!function(t){const e=Fo();t.subscribe(1,t=>{e.send("log",t)})}(i);else{const{stop:e}=function(t,e,n,r,i){const A=[t.logsEndpointBuilder];t.replica&&A.push(t.replica.logsEndpointBuilder);const o=zo({encoder:ys(),request:Oo(A,n),flushController:Yo({pageMayExitObservable:r,sessionExpireObservable:i.expireObservable})});return e.subscribe(1,t=>{o.add(t)}),o}(t,i,s,a,c);o.push(()=>e())}var d;return{handleLog:p,getInternalContext:(d=c,{get:t=>{const e=d.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,accountContext:l,globalContext:h,userContext:f,stop:()=>{o.forEach(t=>t())}}});!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&wr.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach(t=>xr(t,"onReady callback threw an error:")())}(Lr(),"DD_LOGS",ma);const va="0.6.0",ba="SDKLogger",wa={SDK:`[SkyPathSDK v${va}]:`,NETWORK:"[Network]:"},Ea=()=>ma.getLogger(ba),Ca=t=>{if(!t)return{};try{if(t instanceof Response)return Ia(t);if(t instanceof Error)return{message:t.message,name:t.name,stack:t.stack,...Ca(t.context)};if(Array.isArray(t))return t.map(t=>Ca(t));if("object"==typeof t){const e={};for(const[n,r]of Object.entries(t))if("response"===n&&r instanceof Response)e[n]=Ia(r);else if(r instanceof Error)e[n]={message:r.message,name:r.name,stack:r.stack,...Ca(r.context)};else if("object"==typeof r&&null!==r)try{JSON.stringify(r),e[n]=Ca(r)}catch{e[n]="[Circular or Non-Serializable]"}else e[n]=r;return e}return t}catch(t){return{serializationError:"Failed to serialize context",originalErrorMessage:t.message}}},Ia=t=>{if(!t)return{};const e={};if(t.headers&&"function"==typeof t.headers.entries)for(const[n,r]of t.headers.entries())e[n]=r;return{status:t.status,statusText:t.statusText,url:t.url,headers:e,type:t.type}},xa="Invalid listener",Sa="Missing authentication parameters",Na="Failed to authenticate with authCallback",Da="Failed to authenticate with API key",La="Failed to get authentication token";class Ta extends Error{constructor({error:t,context:e={}}){t||=new Error("Unknown error"),super(t.message),this.name=this.constructor.name,this.context=e;const n=Ea(),r=Ca(e);n?.error(this.message,{context:r},e?.error||t)}}class Ma extends Ta{constructor(t,e={}){super({error:new Error(t),context:e})}}class Oa extends Ta{constructor(t,e={}){super({error:new Error(t),context:e})}}class Pa extends Ta{constructor(t,e={}){super({error:new Error(t),context:e})}}class Ra extends Ta{constructor(t,e={}){super({error:new Error(t),context:e})}}class ka extends Ta{constructor(t,e={}){super({error:new Error(t),context:e})}}class Ba{constructor({service:t,cacheTokenService:e}){this.#t=t,this.#e=e,this.#e.start(),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:3e5}),this.#A={polygon:null,isCorridorMode:!1,isEnabled:!0},this.#o={forecast:0,maxAltitude:k,minAltitude:R,minSeverity:0}}#A;#o;#t;#e;#n;#s=!1;#a;#u;#r;#i;#c=er();#l;#f;#h;#p=async({isRequiredNewFetch:t})=>{if(this.#a)try{this.#t.expire();const e=this.#e.getToken();if((t||!this.#s)&&this.#A.polygon&&e){this.#s=!0,this.#u&&(this.#n.abort(lr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch({config:this.#A,token:e,signal:this.#n.signal});this.#d(t),await t}const n=this.#t.getData({config:this.#A,filters:this.#o});this.#l?.(n,this.#c),this.#c=n}catch(t){const e=new ka("Failed to run Forecast flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#A.polygon&&t&&this.#i.run(this.#p.bind(this,{isRequiredNewFetch:!0}))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#a=!1,this.#n.abort(lr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new ka("Failed to stop Forecast flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ma(xa);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ma(xa);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ma(xa);this.#h=t};start=()=>{this.#a=!0,this.#p({isRequiredNewFetch:!0})};stop=()=>this.#g();terminate=()=>{this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e,isEnabled:n,forecast:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{try{(({polygon:t,forecast:e,isCorridorMode:n,isEnabled:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [longitude, latitude]")}if(!H({value:n})&&"boolean"!=typeof n)throw new Error("isCorridorMode must be a boolean");if(!H({value:r})&&"boolean"!=typeof r)throw new Error("isEnabled must be a boolean");if(!H({value:e})){if("number"!=typeof e)throw new Error("forecast must be a number");if(!Hn.includes(e))throw new Error("forecast must be a number between 0 and 24")}if(!H({value:i})){if("number"!=typeof i)throw new Error("maxAltitude must be a number");if(i<A)throw new Error("maxAltitude must be a higher value than minAltitude");if(i<R||i>k)throw new Error("maxAltitude must be a number between 0 and 52")}if(!H({value:A})){if("number"!=typeof A)throw new Error("minAltitude must be a number");if(A<R||A>k)throw new Error("minAltitude must be a number between 0 and 52")}if(!H({value:o})){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(!jn.includes(o))throw new Error("minSeverity must be a number between 0 and 4")}})({polygon:t,isCorridorMode:e,isEnabled:n,forecast:r,maxAltitude:i,minAltitude:A,minSeverity:o});const s={...this.#A},a=Z({current:this.#A,next:{polygon:t,isCorridorMode:e,isEnabled:n}});a.has(Kn)&&(s.isCorridorMode=e),a.has(Jn)&&(s.isEnabled=n),a.has($n)&&(s.polygon=t),this.#A=s,this.#o=J({current:this.#o,next:{forecast:r,maxAltitude:i,minAltitude:A,minSeverity:o}});const u=a.size>0;this.#r.run(this.#p.bind(this,{isRequiredNewFetch:u}))}catch(e){const n=new ka("Failed to update config for Forecast Flow",{error:e,config:{polygon:t}});if(!this.#f)throw n;this.#f(n)}}}class Fa{constructor({fetcher:t,isGtg:e=!1}){this.#y=t,this.#_=new Map,this.#m=e?Wn:Xn,this.#v=null}#_;#m;#y;#b;#v;#w=({polygon:t,polygonSize:e})=>{const n=`${e}-${JSON.stringify(t)}`;if(this.#v?.key===n)return this.#v.result;const r=(({polygon:t,polygonSize:e})=>{const n=F[e];let r,i;if(e===O.CORRIDOR){i=T(t,5,!0);const e=new Set(i.map(t=>D(t,n)));r=Array.from(e)}else if(r=T(t,n,!0),0===r.length){const e=t.map(([t])=>t),i=t.map(([,t])=>t);r=[S((Math.min(...i)+Math.max(...i))/2,(Math.min(...e)+Math.max(...e))/2,n)]}return{hexIds:r,childCells:i}})({polygon:t,polygonSize:e});return this.#v={key:n,result:r},r};fetch=async({config:t,signal:e,token:n})=>{const{polygon:r,isCorridorMode:i,isEnabled:A}=t;if(!r||!A)return;this.#b=await(async()=>{const t=await this.#y({path:this.#m.INFO,method:nr});return t?.data?.lastUpdatedAt})();const o=i?O.CORRIDOR:Gn({polygon:r}),{hexIds:s}=this.#w({polygon:r,polygonSize:o}),a=(({hexIds:t,data:e,currentLastUpdatedAt:n})=>t.filter(t=>{if(!e.has(t))return!0;const r=e.get(t),{lastUpdatedAt:i}=r;return i!==n}))({hexIds:s,data:this.#_,currentLastUpdatedAt:this.#b});if(!a.length||!n)return;const u=a.map(t=>{const r=this.#m.DATA.replace("{res}",String(F[o])).replace("{hexId}",t),i={lastUpdatedAt:this.#b,token:n,forecastH:25};return this.#y({path:r,method:nr,params:i,signal:e})});(await Promise.allSettled(u)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n=a[e],{reports:r}=Zn({response:t.value,lastUpdatedAt:this.#b,parentCell:n});this.#_.set(n,{lastUpdatedAt:this.#b,reports:r})})};getData=({config:t,filters:e})=>{const{polygon:n,isCorridorMode:r,isEnabled:i}=t;if(!n||!i)return er();const{forecast:A,maxAltitude:o,minAltitude:s,minSeverity:a}=e,u=r?O.CORRIDOR:Gn({polygon:n}),{childCells:c}=this.#w({polygon:n,polygonSize:u}),l=(({data:t,filters:e,childCells:n})=>{if(!t)return{};if(!e)return t;const{forecast:r=0,minAltitude:i=R,maxAltitude:A=k,minSeverity:o=1}=e,s=n?.length?new Set(n):null,a={};return t.forEach(({reports:t},e)=>{const n=t.filter(({observationTime:t})=>it.unix(t).diff(it().startOf("hour"),"hour")===r).filter(({alt:t})=>t>=i&&t<=A).filter(({sev:t})=>t>=o).map(t=>{if(!s)return t;const n=t.hexIds.filter(t=>{try{const n=L(t,e,5);return s.has(n)}catch(n){console.warn(`[SkyPath SDK]: Hexagon skipped; ${n?.message||"Error while converting childPos to hexId"}`,{childPos:t,parentCell:e,resolution:5})}});return{...t,hexIds:n}}).filter(t=>t.hexIds.length>0);0!==n.length&&(a[e]=n)}),a})({data:this.#_,filters:{forecast:A,minAltitude:s,maxAltitude:o,minSeverity:a},childCells:c});return er(l)};expire=()=>{this.#_.forEach((t,e)=>{t.lastUpdatedAt!==this.#b&&this.#_.delete(e)})};dispose=()=>{this.#_.clear(),this.#v=null}}const Ga="/v4/aircraft";class Ua{constructor({fetcher:t}){this.#y=t}#y;async getMapping(){let t=Ga,e=nr;try{return await this.#y({path:t,method:e})}catch(n){throw new Oa("Failed to get aircraft mapping",{path:t,method:e,error:n})}}}const Qa=t=>"TypeError"===t?.name&&Object.values(yr).some(e=>t?.message?.includes(e)),za=async({response:t})=>{const e=t.status,n=t.statusText;let r={400:"Bad request, please check the request body;",401:"Unauthorized, please check the API key or JWT;",403:"Forbidden;",404:"Endpoint is not found, please check the URL;",500:"Internal server error;"}[e]||n||"Unknown error";const i=(await t.json().catch(()=>{}))?.message?.split(":")?.at(1)?.trim()||"";return[r,i?`(${i})`:""].join(" ")},qa=({error:t})=>{if(!t)return{};const e={name:t.name,message:t.message,type:"unknown",possibleCauses:[]};return Qa(t)?(e.type="network_error",e.possibleCauses=["Network connectivity issue","CORS policy violation","SSL/TLS certificate problem","Firewall or proxy blocking the request","DNS resolution failure","Server is unreachable"]):"AbortError"===t.name?(e.type="aborted",e.possibleCauses=["Request was cancelled by AbortController"]):t.message?.includes("timeout")?(e.type="timeout",e.possibleCauses=["Request exceeded timeout limit","Server is not responding"]):t.message?.includes("CORS")&&(e.type="cors_error",e.possibleCauses=["CORS policy violation","Missing CORS headers on server"]),t.cause&&(e.cause=t.cause),t.stack&&(e.stack=t.stack),e},Va=(t,e,n)=>{const r=`${t}${e}`;if(!n)return r;const i=Object.entries(n).filter(([,t])=>null!=t);if(0===i.length)return r;return`${r}?${new URLSearchParams(Object.fromEntries(i))}`},Ya=t=>new Promise(e=>setTimeout(e,t));class ja{#E;constructor({environment:t,proxyUrl:e}){this.#E=e||gr[t?.toLowerCase()]||gr[pr]}authenticate=async({apiKey:t,userId:e,companyName:n,authCallback:r})=>{if(![t,e,n,r].filter(Boolean).length)throw new Ma(Sa);return r?await this.#C({authCallback:r}):await this.#I({apiKey:t,userId:e,companyName:n})};async#x({token:t}){const e=`${this.#E}${cr}`,n={method:nr,headers:{[Ar]:t}},r=await fetch(e,n);if(!r.ok){const t=await za({response:r});throw new Error(t)}const{data:i}=await r.json(),{companyId:A,id:o}=i;return{companyId:A,userId:o}}async#I({apiKey:t,userId:e,companyName:n}){try{const r=await this.#S({apiKey:t,userId:e,companyName:n}),i={token:r},A=await this.#x({token:r});return{fetcher:this.#N({tokenProvider:i}),me:A,tokenProvider:i}}catch(t){throw new Ra(Da,{error:t})}}async#C({authCallback:t}){try{const{jwt:e,partnerId:n}=await t(),r=await this.#D({jwt:e,partnerId:n}),i={token:r},A=await this.#x({token:r});return{fetcher:this.#N({tokenProvider:i}),me:A,tokenProvider:i}}catch(t){throw new Ra(Na,{error:t})}}#L=async({path:t,headers:e={},body:n})=>{let r=null,i=null;try{const A=`${this.#E}${t}`,o={method:rr,headers:{[or]:"application/json",...e},body:n?JSON.stringify(n):null};if(i={url:A,options:o},r=await fetch(A,o),!r.ok){const t=await za({response:r});throw new Error(t)}const{data:s}=await r.json(),{token:a}=s;return a}catch(t){throw new Oa(La,{error:t,response:r,request:i})}};#S=async({apiKey:t,userId:e,companyName:n})=>await this.#L({path:sr,headers:{[ir]:t},body:{userId:e,companyName:n}});#D=async({jwt:t,partnerId:e})=>await this.#L({path:ar,body:{signedJwt:t,partnerId:e}});#T=async({token:t})=>await this.#L({path:ur,body:{token:t}});#N=({tokenProvider:t})=>async({path:e="",method:n=nr,params:r,headers:i={},body:A=null,signal:o=null,retry:s=3})=>{const a=Ea(),u={url:Va(this.#E,e,r),options:{method:n,headers:(c=i,l={[Ar]:t.token,[or]:"application/json"},{...c,...l}),body:n!==nr?JSON.stringify(A):null,signal:o}};var c,l;const f=[];let h=null,p=0,d=null;for(;p<s;){p+=1;try{if(h=await fetch(u.url,u.options),h?.ok)return 204===h.status?{data:null}:await h.json()}catch(t){if("AbortError"===t?.name||t?.reason===lr||t===lr)return{data:null,aborted:!0};if(Qa(t))return{data:null,networkError:!0};d=t}if(h){const{status:e}=h,n=429===e,r=e>=500&&e<600;if(401===e)try{const e=await this.#T({token:t.token});t.token=e,u.options.headers[Ar]=t.token}catch(t){const e=qa({error:t});f.push({type:"token_refresh_failed",timestamp:(new Date).toISOString(),errorDetails:e,request:u,response:h,attempt:p,error:t,lastError:d});break}else{if(e>=400&&e<500&&!n){f.push({type:"client_error",timestamp:(new Date).toISOString(),request:u,response:h,attempt:p,lastError:d});break}f.push({attempt:p,timestamp:(new Date).toISOString(),request:u,response:h,type:r?"server_error":"retryable_error",lastError:d})}}p<s&&await Ya(1e3*p)}const g=h?await za({response:h}):"Network request failed after all retries";throw a?.error(g,{context:{url:u.url,method:u.options.method,totalAttempts:p,lastError:d,attempts:f,finalErrorDetails:qa({error:d}),finalResponse:h?{status:h.status,statusText:h.statusText,url:h.url}:null}}),new Oa(g,{response:h,request:u,attempts:f,lastError:d,totalAttempts:p})}}const Ha={DATA:"/adsb/v5/hexagons/{resolution}/{hexId}"},Xa={[O.SMALL]:0,[O.MEDIUM]:1,[O.LARGE]:1,[O.CORRIDOR]:1},Wa={[O.SMALL]:2,[O.MEDIUM]:1,[O.LARGE]:2.5,[O.CORRIDOR]:1},$a="polygon",Ka="isCorridorMode",Ja=(t,e,n={})=>{const{childCells:r}=n,i=[...t.entries()].filter(([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")}).map(([t,e])=>{const[n]=t.split(","),{reports:i}=e;if(!r?.length)return[n,i];const A=i.filter(t=>{const{hexId:e}=t,i=L(e,n,5);return r.includes(i)});return[n,A]});return Object.fromEntries(i)},Za=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],observationTime:e.observationTime[n]}))};class tu{constructor({fetcher:t}){this.#y=t,this.#_=new Map}#_;#y;fetch=async(t,e)=>{const{polygon:n,polygonSize:r}=t;if(!n||!r)return null;r===O.CORRIDOR&&Bn({polygon:n});const i=Xa[r],{hexIds:A,childCells:o}=(({polygon:t,polygonSize:e})=>{let n=t;const r=F[e],i=Wa[e];let A,o;switch(e){case O.LARGE:n=qn({polygon:n,resolution:r,extensionFactor:i});break;case O.CORRIDOR:{o=T(n,5,!0);const t=t=>D(t,1),e=new Set(o.map(t));A=Array.from(e);break}default:n=Rn({polygon:n,resolution:r,extensionFactor:i})}return A??=T(n,r,!0),{hexIds:A,childCells:o}})({polygon:n,polygonSize:r});r===O.LARGE&&([...this.#_.keys()].forEach(t=>!t.includes(r)&&this.#_.delete(t)),[...this.#_.keys()].forEach(t=>!A.includes(t.split(",")[0])&&this.#_.delete(t)));const s=A.filter(t=>{const e=String([t,r,i]);if(!this.#_.has(e))return!0;const n=this.#_.get(e),{fetchedAt:A,updatedAt:o}=n,s=it().unix()-A,a=it().unix()-o;return!(s<60)&&!(a<60)});if(!s.length)return Ja(this.#_,[r,i],{childCells:o});const a=s.map(t=>{const n=Ha.DATA.replace("{hexId}",t).replace("{resolution}",String(F[r])),A=String([t,r,i]),o=this.#_.get(A)?.updatedAt;return this.#y({path:n,method:nr,params:{minSev:i,hoursAgo:4,maxAlt:B.ALT_TO,minAlt:B.ALT_FROM,since:o},signal:e})});return(await Promise.allSettled(a)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n={fetchedAt:it().unix(),reports:Za(t),updatedAt:t.value.data?.updatedAt},A=s[e],o=String([A,r,i]),a=this.#_.get(o);if(!!a?.updatedAt&&!!a?.reports?.length&&a?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=a.reports,i=n.reports;r.forEach(n=>t.set(e(n),n)),i.forEach(n=>t.set(e(n),n));const A=Array.from(t.values()),s={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:A};this.#_.set(o,s)}else this.#_.set(o,n)}),[...this.#_.keys()].forEach(t=>!t.includes(r)&&this.#_.delete(t)),Ja(this.#_,[r,i],{childCells:o})};expire=()=>{const t=[...this.#_.entries()],e=it().unix();t.forEach(t=>{const[n,r]=t,{reports:i,...A}=r,o=i.filter(t=>e-t.observationTime<14400);this.#_.set(n,{...A,reports:o})})};dispose=()=>this.#_.clear()}class eu{constructor({fetcher:t}){this.#t=new tu({fetcher:t}),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:6e4}),this.#A={polygon:null,polygonSize:null,isCorridorMode:!1}}#A;#t;#n;#a;#u;#c;#r;#i;#l;#f;#h;#p=async()=>{if(this.#a)try{this.#t.expire(),this.#u&&(this.#n.abort(lr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch(this.#A,this.#n.signal);this.#d(t);const e=await t;this.#l?.(e,this.#c),this.#c=e}catch(t){const e=new ka("Failed to run ADSB flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#i.run(this.#p.bind(this))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#a=!1,this.#n.abort(lr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new ka("Failed to stop ADSB flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ma(xa);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ma(xa);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ma(xa);this.#h=t};start=()=>{this.#a=!0,this.#p()};stop=()=>this.#g();terminate=()=>{this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e})=>{try{(({polygon:t,isCorridorMode:e})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!H({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean")})({polygon:t,isCorridorMode:e});const n=Z({current:this.#A,next:{polygon:t,isCorridorMode:e}}),r={...this.#A};if(n.has(Ka)&&(r.isCorridorMode=e),n.has($a)&&(r.polygon=t,r.polygonSize=r.isCorridorMode?O.CORRIDOR:Gn({polygon:t})),this.#A=r,!this.#a)return;this.#r.run(this.#p.bind(this))}catch(n){const r=new ka("Failed to updateConfig for ADSB flow",{error:n,config:{polygon:t,isCorridorMode:e}});if(!this.#f)throw r;this.#f(r)}}}const nu=({reports:t,forecastTs:e,hoursAgo:n})=>{const r=(({forecastTs:t})=>{const e=it().unix();return!t||t<=e||t<e+180?e:t})({forecastTs:e}),i=3600*Number(n);return t.map(t=>{const{severities:e,...n}=t,A=e?.find((t,e,n)=>{const A=n[e+1],o=t.observationTime,s=t.observationTime+i,a=A?Math.min(A.observationTime,s):s;return r>=o&&r<a})||{};return{...n,...A}}).filter(t=>t.observationTime)},ru=({oneLayerStore:t,forecastData:e,selector:n,options:{childCells:r,forecastTs:i,hoursAgo:A,isForecastEnabled:o}})=>{const[s]=n,a=r?.length?new Set(r):null,u=new Map;for(const[e,n]of t){const[t,r]=e.split(",");u.has(t)||u.set(t,[]),u.get(t).push({key:e,value:n,polygonSize:r})}if(e&&s!==O.LARGE)for(const t of Object.keys(e))u.has(t)||u.set(t,[]);const c=[];for(const[t,e]of u)if(0===e.length)c.push([t,{reports:[]}]);else if(1===e.length)c.push([e[0].key,e[0].value]);else{const t=e.find(t=>t.polygonSize===s);t&&c.push([t.key,t.value])}const l=c.map(([t,n])=>{const[r]=t.split(","),{reports:s}=n,u=nu({reports:s,forecastTs:i,hoursAgo:A}),c=e&&e[r]&&o?(({oneLayer:t,forecast:e})=>{const n=new Map;return t.forEach(t=>n.set(`${t.hexId}-${t.alt}`,t)),e?.forEach(t=>{t.hexIds.forEach(e=>{const r=`${e}-${t.alt}`;if(n.has(r)){const t=n.get(r);if(t.sources.includes(0))return;n.set(r,{...t,sources:[...t.sources,0]})}else n.set(r,(({hexId:t,forecastItem:e})=>({hexId:t,alt:e.alt,edr:null,sev:2===e.sev?1:e.sev,sources:[0],usedSource:0,observationTime:e.observationTime,usedSourceTs:e.observationTime}))({hexId:e,forecastItem:t}))})}),[...n.values()]})({oneLayer:u,forecast:e[r]}):u;if(!a)return[r,c];const l=c.filter(t=>{const{hexId:e}=t,n=L(e,r,5);return a.has(n)});return[r,l]});return Object.fromEntries(l)},iu=({responseData:t})=>t?t.hexId.map((e,n)=>({hexId:e,alt:t.alt[n],severities:t.severities.sev[n].map((e,r)=>({edr:t.severities.edr[n][r],sev:t.severities.sev[n][r],sources:t.severities.sources[n][r],observationTime:t.severities.ts[n][r],usedSource:t.severities.usedSource[n][r],usedSourceTs:t.severities.usedSourceTs[n][r]}))})):[],Au=t=>{let e=null,n=null;return{toRawObject:()=>t||null,toHexagonsArray:()=>t?(null!==e||(e=On({data:t})),e):null,toFeatureCollection:()=>{if(!t)return null;if(null!==n)return n;const r=e??On({data:t});null===e&&(e=r);const i=Nn({hexagons:r});return n=Sn({hexagons:Object.values(i)}),n}}};class ou{constructor({fetcher:t}){this.#y=t,this.#_=new Map,this.#v=null}#_;#y;#v;#w=({polygon:t,polygonSize:e})=>{const n=`${e}-${JSON.stringify(t)}`;if(this.#v?.key===n)return this.#v.result;const r=(({polygon:t,polygonSize:e})=>{let n=t;const r=F[e],i=dn[e];let A,o;switch(e){case O.LARGE:n=qn({polygon:n,resolution:r,extensionFactor:i});break;case O.CORRIDOR:{o=T(n,5,!0);const t=t=>D(t,1),e=new Set(o.map(t));A=Array.from(e);break}default:n=Rn({polygon:n,resolution:r,extensionFactor:i})}return A??=T(n,r,!0),{hexIds:A,childCells:o}})({polygon:t,polygonSize:e});return this.#v={key:n,result:r},r};fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:i,hoursAgo:A}=t;if(!n||!r)return null;r===O.CORRIDOR&&Bn({polygon:n});const o=pn[r],{hexIds:s}=this.#w({polygon:n,polygonSize:r});r===O.LARGE&&[...this.#_.keys()].forEach(t=>!s.includes(t.split(",")[0])&&this.#_.delete(t));const a=it().unix(),u=s.filter(t=>{const e=String([t,r,o,A,i]);if(!this.#_.has(e))return!0;const n=this.#_.get(e),{fetchedAt:s,updatedAt:u}=n;return!(a-s<60||a-u<60)});if(!u.length)return;const c=u.map(t=>{const n=hn.DATA.replace("{hexId}",t).replace("{res}",String(F[r])),s=String([t,r,o,A,i]),a=this.#_.get(s)?.updatedAt;return this.#y({path:n,method:nr,params:{acCat:i,hoursAgo:A,minAlt:B.ALT_FROM,maxAlt:B.ALT_TO,since:a},signal:e})});(await Promise.allSettled(c)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n={fetchedAt:it().unix(),reports:iu({responseData:t?.value?.data}),updatedAt:t.value.data?.updatedAt},s=u[e],a=String([s,r,o,A,i]),c=this.#_.get(a);if(!!c?.updatedAt&&!!c?.reports?.length&&c?.updatedAt!==n.updatedAt){const t=(({oldReports:t,newReports:e})=>{const n=new Map,r=({item:t})=>`${t.hexId}-${t.alt}`;return t.forEach(t=>n.set(r({item:t}),t)),e.forEach(t=>n.set(r({item:t}),t)),Array.from(n.values())})({oldReports:c.reports,newReports:n.reports}),e={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:t};this.#_.set(a,e)}else this.#_.set(a,n)})};getData=({config:t,filters:e,forecastData:n})=>{const{polygon:r,polygonSize:i,aircraftCategory:A,hoursAgo:o,isForecastEnabled:s}=t,{maxAltitude:a,minAltitude:u,minSeverity:c,forecastTs:l}=e;if(!r||!i)return Au();const f=pn[i],{childCells:h}=this.#w({polygon:r,polygonSize:i}),p=ru({oneLayerStore:this.#_,forecastData:n,selector:[i,f,o,A],options:{childCells:h,forecastTs:l,hoursAgo:o,isForecastEnabled:s}}),d=Mn({data:p,filters:{minAltitude:u,maxAltitude:a,minSeverity:c,hoursAgo:o,polygonSize:i}});return Au(d)};expire=()=>{this.#_=(({store:t,hoursAgo:e})=>{const n=new Map(t),r=it().unix(),i=3600*Number(e);return[...n.entries()].forEach(t=>{const[e,A]=t,{reports:o,...s}=A,a=[];o.forEach(t=>{const e=t?.severities?.filter(t=>t.observationTime+i>r);e.length&&a.push({...t,severities:e})}),a.length?n.set(e,{...s,reports:a}):n.delete(e)}),n})({store:this.#_,hoursAgo:Number(fn.fourHours)})};dispose=()=>{this.#_.clear(),this.#v=null}}class su{constructor({fetcher:t,cacheTokenService:e,forecastService:n}){this.#t=new ou({fetcher:t}),this.#M=new Ba({service:n,cacheTokenService:e}),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:6e4}),this.#A={polygon:null,polygonSize:null,isCorridorMode:!1,isForecastEnabled:!0,hoursAgo:Number(fn.oneHour),aircraftCategory:ln.C60},this.#o={forecastTs:null,forecastAlt:35,maxAltitude:B.ALT_TO,minAltitude:B.ALT_FROM,minSeverity:B.SEVERITY}}#A;#o;#t;#M;#n;#a;#O;#u;#c=Au();#r;#i;#l;#f;#h;#p=async({isRequiredNewFetch:t})=>{if(this.#a)try{if(this.#t.expire(),t&&this.#A.polygon){this.#u&&(this.#n.abort(lr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch({config:this.#A,signal:this.#n.signal});this.#d(t),await t}const e=this.#t.getData({config:this.#A,filters:this.#o,forecastData:this.#O});this.#l?.(e,this.#c),this.#c=e}catch(t){const e=new ka("Failed to run OneLayer flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#A.polygon&&t&&this.#i.run(this.#p.bind(this,{isRequiredNewFetch:!0}))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#M.stop(),this.#a=!1,this.#n.abort(lr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new ka("Failed to stop OneLayer flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ma(xa);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ma(xa);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ma(xa);this.#h=t};start=()=>{this.#M.start(),this.#M.onData(t=>{this.#O=t.toRawObject(),this.#p({isRequiredNewFetch:!1})}),this.#a=!0,this.#p({isRequiredNewFetch:!0})};stop=()=>this.#g();terminate=()=>{this.#M.terminate(),this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:i,forecastTs:A,forecastAlt:o,maxAltitude:s,minAltitude:a,minSeverity:u})=>{try{(({polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:i,maxAltitude:A,minAltitude:o,minSeverity:s,forecastTs:a,forecastAlt:u})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!H({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!H({value:n})&&"boolean"!=typeof n)throw new Error("isForecastEnabled must be a boolean");if(!H({value:r})){if("string"!=typeof r)throw new Error("aircraftCategory must be a string");if(!Object.values(ln).includes(r))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!H({value:i})){if("string"!=typeof i)throw new Error("hoursAgo must be a string");if(!Object.values(fn).includes(i))throw new Error("hoursAgo must be one of the allowed values, '0.5', '1', '2' ,'4'")}if(!H({value:A})){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<o)throw new Error("maxAltitude must be a higher value than minAltitude");if(A<R||A>k)throw new Error("maxAltitude must be a number between 0 and 52")}if(!H({value:o})){if("number"!=typeof o)throw new Error("minAltitude must be a number");if(o>A)throw new Error("minAltitude must be a lower value than maxAltitude");if(o<R||o>k)throw new Error("minAltitude must be a number between 0 and 52")}if(!H({value:s})){if("number"!=typeof s)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(s))throw new Error("minSeverity must be a number between 0 and 4")}if(!H({value:a})){if("number"!=typeof a)throw new Error("forecastTs must be a number");if(!it.unix(a).isValid())throw new Error("forecastTs must be a valid Unix timestamp")}if(!H({value:u})){if("number"!=typeof u)throw new Error("forecastAlt must be a number");if(u<R||u>k)throw new Error(`forecastAlt must be a number between ${R} and ${k}`)}})({polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:i,forecastTs:A,forecastAlt:o,maxAltitude:s,minAltitude:a,minSeverity:u});const c={...this.#A},l=Z({current:this.#A,next:{polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:Number(i)}});l.has(yn)&&(c.isCorridorMode=e),l.has(_n)&&(c.isForecastEnabled=n),l.has(gn)&&(c.polygon=t,c.polygonSize=c.isCorridorMode?O.CORRIDOR:Gn({polygon:t})),l.has(mn)&&(c.aircraftCategory=r),l.has(vn)&&(c.hoursAgo=Number(i)),this.#A=c,this.#o=J({current:this.#o,next:{forecastTs:A,forecastAlt:o,maxAltitude:s,minAltitude:a,minSeverity:u}});const f=this.#o.forecastTs?Math.min(24,Math.max(0,it.unix(this.#o.forecastTs).startOf("hour").diff(it().startOf("hour"),"hour"))):0;this.#M.updateConfig({polygon:t,isCorridorMode:e,isEnabled:n,forecast:f,maxAltitude:o??k,minAltitude:o??R,minSeverity:u});const h=l.size>0;this.#r.run(this.#p.bind(this,{isRequiredNewFetch:h}))}catch(i){const A=new ka("Failed to update config for OneLayerFlow",{error:i,config:{polygon:t,isForecastEnabled:n,isCorridorMode:e,aircraftCategory:r}});if(!this.#f)throw A;this.#f(A)}}}const au=({polygon:t,polygonSize:e})=>{let n=t;const r=F[e],i=z[e];let A,o;switch(e){case O.LARGE:n=qn({polygon:n,resolution:r,extensionFactor:i});break;case O.CORRIDOR:{o=T(n,5,!0);const t=t=>D(t,1),e=new Set(o.map(t));A=Array.from(e);break}default:n=Rn({polygon:n,resolution:r,extensionFactor:i})}return A??=T(n,r,!0),{hexIds:A,childCells:o}},uu=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],edr:e.edr[n],observationTime:e.observationTime[n]}))},cu=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?On({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=On({data:t}),n=Nn({hexagons:e});return Sn({hexagons:Object.values(n)})}});class lu{constructor({fetcher:t}){this.#y=t,this.#_=new Map}#_;#y;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:i}=t;if(!n||!r)return;r===O.CORRIDOR&&Bn({polygon:n});const A=Q[r],{hexIds:o}=au({polygon:n,polygonSize:r});r===O.LARGE&&[...this.#_.keys()].forEach(t=>!o.includes(t.split(",")[0])&&this.#_.delete(t));const s=o.filter(t=>{const e=String([t,r,A,i]);if(!this.#_.has(e))return!0;const n=this.#_.get(e),{fetchedAt:o,updatedAt:s}=n,a=it().unix()-o,u=it().unix()-s;return!(a<60)&&!(u<60)});if(!s.length)return;const a=s.map(t=>{const n=U.DATA.replace("{hexId}",t).replace("{resolution}",String(F[r])),o=String([t,r,A,i]),s=this.#_.get(o)?.updatedAt;return this.#y({path:n,method:nr,params:{minSev:A,hoursAgo:4,maxAlt:B.ALT_TO,minAlt:B.ALT_FROM,acCat:i,since:s},signal:e})});(await Promise.allSettled(a)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n={fetchedAt:it().unix(),reports:uu(t),updatedAt:t.value.data?.updatedAt},o=s[e],a=String([o,r,A,i]),u=this.#_.get(a);if(!!u?.updatedAt&&!!u?.reports?.length&&u?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=u.reports,i=n.reports;r.forEach(n=>t.set(e(n),n)),i.forEach(n=>t.set(e(n),n));const A=Array.from(t.values()),o={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:A};this.#_.set(a,o)}else this.#_.set(a,n)}),[...this.#_.keys()].forEach(t=>!t.includes(r)&&this.#_.delete(t))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:i}=t;if(!n||!r)return cu();const A=Q[r],{childCells:o}=au({polygon:n,polygonSize:r}),s=((t,e,n={})=>{const{childCells:r}=n,i=[...t.entries()].filter(([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")}).map(([t,e])=>{const[n]=t.split(","),{reports:i}=e;if(!r?.length)return[n,i];const A=i.filter(t=>{const{hexId:e}=t,i=L(e,n,5);return r.includes(i)});return[n,A]});return Object.fromEntries(i)})(this.#_,[r,A,i],{childCells:o}),{historyHours:a,maxAltitude:u,minAltitude:c,minSeverity:l}=e,f=Tn({data:s,filters:{historyHours:a,minAltitude:c,maxAltitude:u,minSeverity:l}});return cu(f)};expire=()=>{const t=[...this.#_.entries()],e=it().unix();t.forEach(t=>{const[n,r]=t,{reports:i,...A}=r,o=i.filter(t=>e-t.observationTime<14400);this.#_.set(n,{...A,reports:o})})};dispose=()=>this.#_.clear()}class fu{constructor({fetcher:t}){this.#t=new lu({fetcher:t}),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:6e4}),this.#A={polygon:null,polygonSize:null,isCorridorMode:!1,aircraftCategory:G.C60},this.#o={historyHours:2,maxAltitude:k,minAltitude:R,minSeverity:0}}#A;#o;#t;#n;#a;#u;#r;#i;#c=cu();#l;#f;#h;#p=async({isRequiredNewFetch:t})=>{if(this.#a)try{if(this.#t.expire(),t&&this.#A.polygon){this.#u&&(this.#n.abort(lr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch({config:this.#A,signal:this.#n.signal});this.#d(t),await t}const e=this.#t.getData({config:this.#A,filters:this.#o});this.#l?.(e,this.#c),this.#c=e}catch(t){const e=new ka("Failed to run Observations flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#A.polygon&&t&&this.#i.run(this.#p.bind(this,{isRequiredNewFetch:!0}))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#a=!1,this.#n.abort(lr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new ka("Failed to stop Observations flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ma(xa);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ma(xa);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ma(xa);this.#h=t};start=()=>{this.#a=!0,this.#p({isRequiredNewFetch:!0})};stop=()=>this.#g();terminate=()=>{this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!H({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!H({value:n})){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(G).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!H({value:r})){if("number"!=typeof r)throw new Error("historyHours must be a number");if(![.5,1,2,3,4].includes(r))throw new Error("historyHours must be one of the allowed values, 0.5, 1, 2, 4")}if(!H({value:i})){if("number"!=typeof i)throw new Error("maxAltitude must be a number");if(i<A)throw new Error("maxAltitude must be a higher value than minAltitude");if(i<R||i>k)throw new Error("maxAltitude must be a number between 0 and 52")}if(!H({value:A})){if("number"!=typeof A)throw new Error("minAltitude must be a number");if(A>i)throw new Error("minAltitude must be a lower value than maxAltitude");if(A<R||A>k)throw new Error("minAltitude must be a number between 0 and 52")}if(!H({value:o})){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(o))throw new Error("minSeverity must be a number between 0 and 4")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o});const s={...this.#A},a=Z({current:this.#A,next:{polygon:t,isCorridorMode:e,aircraftCategory:n}});a.has(V)&&(s.isCorridorMode=e),a.has(q)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?O.CORRIDOR:Gn({polygon:t})),a.has(Y)&&(s.aircraftCategory=n),this.#A=s,this.#o=J({current:this.#o,next:{historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o}});const u=a.size>0;this.#r.run(this.#p.bind(this,{isRequiredNewFetch:u}))}catch(r){const i=new ka("Failed to update config for ObservationsFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#f)throw i;this.#f(i)}}}const hu="/v5/cache-token";class pu{constructor({fetcher:t}){this.#y=t,this.#i}#y;#i;#P;#R;#k=!1;#a=!1;#B=!1;#F=0;#G=()=>Math.min(1e4*2**this.#F,3e5);#U=({timeToExpireInMs:t})=>{clearTimeout(this.#i);const e=Math.max(0,t);this.#i=setTimeout(()=>{this.#i=null,this.#p()},e)};#p=async()=>{if(this.#a=!0,"undefined"!=typeof navigator&&!navigator.onLine)return this.#U({timeToExpireInMs:this.#G()}),void(this.#F+=1);try{if(this.#i)return;const t=await this.#y({path:hu});if(t?.networkError)throw new Oa("Network request failed",{path:hu,response:t});if(!t?.data?.token||!t?.data?.expireAt)throw new Oa("Invalid response structure from fetcher",{path:hu,response:t});this.#P=t.data.token,this.#R=t.data.expireAt,this.#F=0;const e=it(this.#R).add(5,"second").diff(it(),"milliseconds");this.#U({timeToExpireInMs:e}),this.#k=!0}catch(t){if(this.#U({timeToExpireInMs:this.#G()}),this.#F+=1,!(t instanceof Oa)){const e=qa({error:t});new Oa("Failed to get cache token",{path:hu,error:t,errorDetails:e})}}};start=()=>{this.#k||this.#a||this.#p()};stop=()=>{this.#k=!1,this.#a=!1,clearTimeout(this.#i)};getToken=()=>this.#k&&this.#a?(!this.#P&&this.#k&&new ka("Token not yet initialized. Ensure start() is called and wait for initial token fetch to complete."),this.#B=it(this.#R).isBefore(it()),this.#B?null:this.#P):null}return t.CoreUtils=et,t.GeoUtils=Vn,t.Observations=Yn,t.default=async({apiKey:t,userId:e,companyName:n,authCallback:r,environment:i=pr,proxyUrl:A,applicationId:o,isMonitoringEnabled:s=!0,shouldCollectConsoleLogs:a=!1,shouldCollectErrors:u=!1})=>{try{const c=new ja({environment:i,proxyUrl:A}),{fetcher:l,me:f}=await c.authenticate({apiKey:t,userId:e,companyName:n,authCallback:r});(({isEnabled:t,collectConsole:e,collectErrors:n,applicationId:r,environment:i,companyId:A,userId:o})=>{t&&i?.toLowerCase()!==fr&&(ma.init({clientToken:"pub0b945dd1505a74367a4f900219c56210",service:"skypath-web-sdk",site:"datadoghq.com",env:i,version:va,forwardErrorsToLogs:n,forwardConsoleLogs:e?"all":[],sessionSampleRate:100,beforeSend:t=>{switch(t.origin){case"logger":{const e=t.logger?.name||"unknown-logger",n={[ba]:wa.SDK}[e]||`[${e}]`;return t.message=`${n} ${t.message}`,!0}case"network":{const e=t?.http?.status_code;return 0!==e||(t.message=[wa.NETWORK,t.message].join(" ")),!0}default:return!1}}}),ma.setGlobalContext({applicationId:r,companyId:A,userId:o}),ma.createLogger(ba,{level:"info",handler:"http",context:{applicationId:r}}))})({isEnabled:s,collectConsole:a,collectErrors:u,applicationId:o,environment:i,companyId:f?.companyId,userId:f?.userId});const h=new Ua({fetcher:l}),p=await h.getMapping(),d=new pu({fetcher:l});return{createForecastFlow:()=>{const t=new Fa({fetcher:l,isGtg:!1});return new Ba({service:t,cacheTokenService:d})},createGtgFlow:()=>{const t=new Fa({fetcher:l,isGtg:!0});return new Ba({service:t,cacheTokenService:d})},createObservationsFlow:()=>new fu({fetcher:l}),createOneLayerFlow:()=>{const t=new Fa({fetcher:l,isGtg:!1});return new su({fetcher:l,cacheTokenService:d,forecastService:t})},createAdsbFlow:()=>new eu({fetcher:l}),mapAircraftIcaoToAircraftType:({icao:t})=>j({icao:t,mapping:p})}}catch(t){throw new Pa(t.message,{error:t})}},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
6
|
+
var SkyPathSDK=function(t){"use strict";var e=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,A="";"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),A=0!==A.indexOf("blob:")?A.substr(0,A.lastIndexOf("/")+1):"",i=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=V(t);i?e(i.buffer):n()}},r.onerror=n,r.send(null)};var o=n.print||console.log.bind(console),s=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments;var a=0;var u=!1;function c(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||rt("Assertion failed: "+e),r}function l(t,e,n,r,i){var A={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,A=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=A)break;e[n++]=s}else if(s<=2047){if(n+1>=A)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=A)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=A)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,p,e,n)})(t,e=W(n),n)}return e},array:function(t){var e=W(t.length);return function(t,e){h.set(t,e)}(t,e),e}};var o=c(t),s=[],a=0;if(r)for(var u=0;u<r.length;u++){var l=A[n[u]];l?(0===a&&(a=K()),s[u]=l(r[u])):s[u]=r[u]}var f=o.apply(null,s);return f=function(t){return"string"===e?v(t):"boolean"===e?Boolean(t):t}(f),0!==a&&$(a),f}var f,h,p,d,g,y,_,m="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function v(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&m)return m.decode(t.subarray(e,i));for(var A="";e<i;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var a=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|a:(7&o)<<18|s<<12|a<<6|63&t[e++])<65536)A+=String.fromCharCode(o);else{var u=o-65536;A+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else A+=String.fromCharCode((31&o)<<6|s)}else A+=String.fromCharCode(o)}return A}(p,t,e):""}function b(t,e){return t%e>0&&(t+=e-t%e),t}function w(t){f=t,n.HEAP8=h=new Int8Array(t),n.HEAP16=d=new Int16Array(t),n.HEAP32=g=new Int32Array(t),n.HEAPU8=p=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=y=new Float32Array(t),n.HEAPF64=_=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var E=n.TOTAL_MEMORY||33554432;function C(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}E=(f=n.buffer?n.buffer:new ArrayBuffer(E)).byteLength,w(f),g[7156]=5271536;var I=[],x=[],S=[],N=[];function D(t){I.unshift(t)}function L(t){N.unshift(t)}var T=Math.abs,M=Math.ceil,O=Math.floor,P=Math.min,R=0,k=null;n.preloadedImages={},n.preloadedAudios={};var B,F,G=null,U="data:application/octet-stream;base64,";function Q(t){return String.prototype.startsWith?t.startsWith(U):0===t.indexOf(U)}G="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMAdmVydGV4Um90YXRpb25zAGNlbGxUb1ZlcnRleABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";function z(){return h.length}var q="function"==typeof atob?atob:function(t){var e,n,r,i,A,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(u++))<<2|(i=s.indexOf(t.charAt(u++)))>>4,n=(15&i)<<4|(A=s.indexOf(t.charAt(u++)))>>2,r=(3&A)<<6|(o=s.indexOf(t.charAt(u++))),a+=String.fromCharCode(e),64!==A&&(a+=String.fromCharCode(n)),64!==o&&(a+=String.fromCharCode(r))}while(u<t.length);return a};function V(t){if(Q(t))return function(t){try{for(var e=q(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(U.length))}var Y=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var A=new t.Float64Array(n),o=0|e.o,s=0|e.p,a=t.Math.floor,u=t.Math.abs,c=t.Math.sqrt,l=t.Math.pow,f=t.Math.cos,h=t.Math.sin,p=t.Math.tan,d=t.Math.acos,g=t.Math.asin,y=t.Math.atan,_=t.Math.atan2,m=t.Math.ceil,v=t.Math.imul,b=t.Math.min,w=t.Math.max,E=t.Math.clz32,C=e.b,I=e.c,x=e.d,S=e.e,N=e.f,D=e.g,L=e.h,T=e.i,M=28656;function O(t,e,n,r){return 0|P(t|=0,e|=0,n|=0,r|=0,0)}function P(t,e,n,r,A){var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,a=o,!(0|R(t|=0,e|=0,n|=0,r|=0,A|=0)))return M=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|de(15,a)))break;a=0|i[(u=a)>>2],u=0|i[u+4>>2]}else c=0|sn(0|n,0|(s=((0|n)<0)<<31>>31),3,0),u=0|I(),s=0|en(0|n,0|s,1,0),s=0|en(0|(s=0|sn(0|c,0|u,0|s,0|I())),0|I(),1,0),u=0|I(),i[a>>2]=s,i[a+4>>2]=u,a=s;if(_n(0|r,0,a<<3),0|A){_n(0|A,0,a<<2),s=0|k(t,e,n,r,A,a,u,0);break}(s=0|tn(a,4))?(c=0|k(t,e,n,r,s,a,u,0),Ze(s),s=c):s=13}else s=2}while(0);return M=o,0|(c=s)}function R(t,e,n,r,A){t|=0,e|=0,n|=0,r|=0,A|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,g=s+8|0,i[(d=o=s)>>2]=t,i[d+4>>2]=e,(0|n)<0)return M=s,0|(g=2);if(i[(a=r)>>2]=t,i[a+4>>2]=e,(a=!!(0|A))&&(i[A>>2]=0),0|jt(t,e))return M=s,0|(g=9);i[g>>2]=0;t:do{if((0|n)>=1)if(a)for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|jt(a=0|i[(e=o)>>2],e=0|i[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|i[26800+(p<<2)>>2],g,o)))break t;if(a=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(h<<3)|0)>>2]=a,i[t+4>>2]=e,i[A+(h<<2)>>2]=d,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|jt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|jt(a=0|i[(e=o)>>2],e=0|i[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|i[26800+(p<<2)>>2],g,o)))break t;if(a=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(h<<3)|0)>>2]=a,i[t+4>>2]=e,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|jt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else a=0}while(0);return M=s,0|(g=a)}function k(t,e,n,r,A,o,s,a){n|=0,r|=0,A|=0,a|=0;var u,c,l,f=0,h=0,p=0,d=0,g=0,y=0,_=0;if(l=M,M=M+16|0,u=l+8|0,c=l,f=0|un(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),p=0|I(),!(!(0|(_=0|i[(y=d=r+(f<<3)|0)>>2]))&!(0|(y=0|i[y+4>>2]))|(h=(0|_)==(0|t)&(0|y)==(0|e))))do{f=0|an(0|(f=0|en(0|f,0|p,1,0)),0|I(),0|o,0|s),p=0|I(),h=(0|(y=0|i[(_=d=r+(f<<3)|0)>>2]))==(0|t)&(0|(_=0|i[_+4>>2]))==(0|e)}while(!(!(0|y)&!(0|_)|h));if(f=A+(f<<2)|0,h&&(0|i[f>>2])<=(0|a))return M=l,0|(_=0);if(i[(_=d)>>2]=t,i[_+4>>2]=e,i[f>>2]=a,(0|a)>=(0|n))return M=l,0|(_=0);switch(h=a+1|0,i[u>>2]=0,0|(f=0|B(t,e,2,u,c))){case 9:g=9;break;case 0:(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h))||(g=9)}t:do{if(9==(0|g)){switch(i[u>>2]=0,0|(f=0|B(t,e,3,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,1,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,5,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,4,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}switch(i[u>>2]=0,0|(f=0|B(t,e,6,u,c))){case 9:break;case 0:if(0|(f=0|k(0|i[(f=c)>>2],0|i[f+4>>2],n,r,A,o,s,h)))break t;break;default:break t}return M=l,0|(_=0)}}while(0);return M=l,0|(_=f)}function B(t,e,n,r,A){t|=0,e|=0,A|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if((n|=0)>>>0>6)return 0|(A=1);if(f=(0|i[(r|=0)>>2])%6|0,i[r>>2]=f,(0|f)>0){a=0;do{n=0|bt(n),a=a+1|0}while((0|a)<(0|i[r>>2]))}if(f=0|ln(0|t,0|e,45),I(),(s=127&f)>>>0>121)return 0|(A=5);o=0|Wt(t,e),a=0|ln(0|t,0|e,52),I(),a&=15;t:do{if(a){for(;;){if(c=0|ln(0|t,0|e,0|(u=3*(15-a|0)|0)),I(),7==(0|(c&=7))){e=5;break}if(p=!(0|te(a)),a=a+-1|0,h=0|fn(7,0,0|u),e&=~I(),t=0|fn(0|i[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|t&~h,e|=u=0|I(),!(n=0|i[(p?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!a){l=8;break t}}return 0|e}l=8}while(0);8==(0|l)&&(t|=0|fn(0|(p=0|i[848+(28*s|0)+(n<<2)>>2]),0,45),e=I()|-1040385&e,n=0|i[4272+(28*s|0)+(n<<2)>>2],127&~p||(p=0|fn(0|i[848+(28*s|0)+20>>2],0,45),e=I()|-1040385&e,n=0|i[4272+(28*s|0)+20>>2],t=0|Kt(p|t,e),e=0|I(),i[r>>2]=1+(0|i[r>>2]))),c=0|ln(0|t,0|e,45),I(),c&=127;t:do{if(0|z(c)){e:do{if(1==(0|Wt(t,e))){if((0|s)!=(0|c)){if(0|j(c,0|i[7696+(28*s|0)>>2])){t=0|Zt(t,e),u=1,e=0|I();break}x(27795,26864,533,26872)}switch(0|o){case 3:t=0|Kt(t,e),e=0|I(),i[r>>2]=1+(0|i[r>>2]),u=0;break e;case 5:t=0|Zt(t,e),e=0|I(),i[r>>2]=5+(0|i[r>>2]),u=0;break e;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){a=0;do{t=0|$t(t,e),e=0|I(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|q(c))){if(!!(0|u)|5!=(0|Wt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&f){case 8:case 118:break t}3!=(0|Wt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){a=0;do{t=0|Kt(t,e),e=0|I(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(p=A)>>2]=t,i[p+4>>2]=e,0|(p=0)}function F(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var A,o,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(o=M,M=M+16|0,d=o+8|0,i[(p=A=o)>>2]=t,i[p+4>>2]=e,(0|n)<0)return M=o,0|(d=2);if(!n)return i[(d=r)>>2]=t,i[d+4>>2]=e,M=o,0|(d=0);i[d>>2]=0;t:do{if(0|jt(t,e))t=9;else{s=0,p=t;do{if(0|(t=0|B(p,e,4,d,A)))break t;if(s=s+1|0,0|jt(p=0|i[(e=A)>>2],e=0|i[e+4>>2])){t=9;break t}}while((0|s)<(0|n));i[(h=r)>>2]=p,i[h+4>>2]=e,h=n+-1|0,f=0,t=1;do{if(s=26800+(f<<2)|0,5==(0|f))for(u=0|i[s>>2],a=0,s=t;;){if(0|(t=0|B(0|i[(t=A)>>2],0|i[t+4>>2],u,d,A)))break t;if((0|a)!=(0|h)){if(c=0|i[(l=A)>>2],l=0|i[l+4>>2],i[(t=r+(s<<3)|0)>>2]=c,i[t+4>>2]=l,0|jt(c,l)){t=9;break t}t=s+1|0}else t=s;if((0|(a=a+1|0))>=(0|n))break;s=t}else for(u=A,l=0|i[s>>2],c=0,s=t,a=0|i[u>>2],u=0|i[u+4>>2];;){if(0|(t=0|B(a,u,l,d,A)))break t;if(a=0|i[(u=A)>>2],u=0|i[u+4>>2],i[(t=r+(s<<3)|0)>>2]=a,i[t+4>>2]=u,t=s+1|0,0|jt(a,u)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}f=f+1|0}while(f>>>0<6);t=(0|p)==(0|i[(t=A)>>2])&&(0|e)==(0|i[t+4>>2])?0:9}}while(0);return M=o,0|(d=t)}function G(t,e,n,r){t|=0,e|=0,r|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;if(A=M,M=M+16|0,a=A,!(n|=0))return i[r>>2]=t,i[r+4>>2]=e,M=A,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(o=0|de(15,a)))break;o=0|i[(s=a)>>2],s=0|i[s+4>>2]}else f=0|sn(0|n,0|(o=((0|n)<0)<<31>>31),3,0),s=0|I(),o=0|en(0|n,0|o,1,0),o=0|en(0|(o=0|sn(0|f,0|s,0|o,0|I())),0|I(),1,0),s=0|I(),i[(f=a)>>2]=o,i[f+4>>2]=s;if(l=0|tn(o,8)){if(!(f=0|tn(o,4))){Ze(l),o=13;break}if(0|(o=0|k(t,e,n,l,f,o,s,0))){Ze(l),Ze(f);break}if(e=0|i[a>>2],(0|(a=0|i[a+4>>2]))>0|!(0|a)&e>>>0>0){o=0,u=0,c=0;do{!(0|(s=0|i[(t=l+(u<<3)|0)>>2]))&!(0|(t=0|i[t+4>>2]))||(0|i[f+(u<<2)>>2])!=(0|n)||(i[(h=r+(o<<3)|0)>>2]=s,i[h+4>>2]=t,o=o+1|0),u=0|en(0|u,0|c,1,0),c=0|I()}while((0|c)<(0|a)|(0|c)==(0|a)&u>>>0<e>>>0)}Ze(l),Ze(f),o=0}else o=13}else o=2}while(0);return M=A,0|(h=o)}function U(t,e,n,r){n|=0,r|=0;var A,o,s,a=0,u=0;for(s=M,M=M+16|0,A=s,o=s+8|0,a=(a=!(0|jt(t|=0,e|=0)))?1:2;;){if(i[o>>2]=0,!(0|B(t,e,a,o,A))&((0|i[(u=A)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0)){t=4;break}if((a=a+1|0)>>>0>=7){a=7,t=4;break}}return 4==(0|t)?(M=s,0|a):0}function Q(t,e,n,r,o,s,a){e|=0,n|=0,r|=0,o|=0,s|=0,a|=0;var u,c,l,f,h,p,d,g,y,_,m=0,v=0,b=0,w=0,E=0,C=0,x=0,S=0,N=0,D=0,L=0,T=0,O=0,P=0,R=0,k=0,B=0,F=0,G=0;if(_=M,M=M+64|0,d=_+48|0,g=_+32|0,y=_+24|0,u=_+8|0,c=_,(0|(v=0|i[(t|=0)>>2]))<=0)return M=_,0|(R=0);for(l=t+4|0,f=d+8|0,h=g+8|0,p=u+8|0,m=0,O=0;;){T=(b=0|i[l>>2])+(O<<4)|0,i[d>>2]=i[T>>2],i[d+4>>2]=i[T+4>>2],i[d+8>>2]=i[T+8>>2],i[d+12>>2]=i[T+12>>2],(0|O)==(v+-1|0)?(i[g>>2]=i[b>>2],i[g+4>>2]=i[b+4>>2],i[g+8>>2]=i[b+8>>2],i[g+12>>2]=i[b+12>>2]):(T=b+(O+1<<4)|0,i[g>>2]=i[T>>2],i[g+4>>2]=i[T+4>>2],i[g+8>>2]=i[T+8>>2],i[g+12>>2]=i[T+12>>2]),v=0|rt(d,g,r,y);t:do{if(v)b=0,m=v;else if(b=0|i[(v=y)>>2],(0|(v=0|i[v+4>>2]))>0|!(0|v)&b>>>0>0){L=0,T=0;e:for(;;){if(B=1/(+(b>>>0)+4294967296*+(0|v)),G=+A[d>>3],F=+((v=0|nn(0|b,0|v,0|L,0|T))>>>0)+4294967296*+(0|I()),k=+(L>>>0)+4294967296*+(0|T),A[u>>3]=B*(G*F)+B*(+A[g>>3]*k),A[p>>3]=B*(+A[f>>3]*F)+B*(+A[h>>3]*k),0|(v=0|ee(u,r,c))){m=v;break}C=0|un(0|(N=0|i[(D=c)>>2]),0|(D=0|i[D+4>>2]),0|e,0|n),w=0|I(),b=0|i[(E=v=a+(C<<3)|0)>>2],E=0|i[E+4>>2];n:do{if(!(0|b)&!(0|E))P=v,R=16;else for(x=0,S=0;;){if((0|x)>(0|n)|(0|x)==(0|n)&S>>>0>e>>>0){m=1;break e}if((0|b)==(0|N)&(0|E)==(0|D))break n;if(C=0|an(0|(v=0|en(0|C,0|w,1,0)),0|I(),0|e,0|n),w=0|I(),S=0|en(0|S,0|x,1,0),x=0|I(),!(0|(b=0|i[(E=v=a+(C<<3)|0)>>2]))&!(0|(E=0|i[E+4>>2]))){P=v,R=16;break}}}while(0);if(16!=(0|R)||(R=0,!(0|N)&!(0|D))||(i[(S=P)>>2]=N,i[S+4>>2]=D,S=s+(i[o>>2]<<3)|0,i[S>>2]=N,i[S+4>>2]=D,S=0|en(0|i[(S=o)>>2],0|i[S+4>>2],1,0),N=0|I(),i[(D=o)>>2]=S,i[D+4>>2]=N),L=0|en(0|L,0|T,1,0),T=0|I(),b=0|i[(v=y)>>2],!((0|(v=0|i[v+4>>2]))>(0|T)|(0|v)==(0|T)&b>>>0>L>>>0)){b=1;break t}}b=0}else b=1}while(0);if(O=O+1|0,!b){R=21;break}if((0|O)>=(0|(v=0|i[t>>2]))){m=0,R=21;break}}return 21==(0|R)?(M=_,0|m):0}function z(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|i[7696+(28*t|0)+16>>2])}function q(t){return 4==(0|(t|=0))|117==(0|t)|0}function V(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function Y(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7696+(28*t|0)+24>>2])==(0|e))}function H(t,e){return 0|i[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function X(t,e){return e|=0,(0|i[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[848+(28*t|0)+24>>2])==(0|e)?6:7)}function W(t){var e,n,r;return e=(r=+A[(t|=0)+16>>3])-(n=+A[t+24>>3]),+(r<n?e+6.283185307179586:e)}function $(t){return+A[(t|=0)+16>>3]<+A[t+24>>3]|0}function K(t){return+(+A[(t|=0)>>3]-+A[t+8>>3])}function J(t,e){t|=0;var n,r,i=0;return(i=+A[(e|=0)>>3])>=+A[t+8>>3]&&i<=+A[t>>3]?(n=+A[t+16>>3],i=+A[t+24>>3],e=(r=+A[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Z(t,e){e|=0;var n,r,i,o,s,a=0,u=0,c=0,l=0;return+A[(t|=0)>>3]<+A[e+8>>3]||+A[t+8>>3]>+A[e>>3]?0|(a=0):(i=(u=+A[t+16>>3])<(l=+A[(n=t+24|0)>>3]),c=(s=+A[(a=e+16|0)>>3])<(o=+A[(r=e+24|0)>>3]),e=l-s<o-u,t=i?c|e?1:2:0,e=c?i?1:e?2:1:0,(u=+fe(u,t))<+fe(+A[r>>3],e)||(l=+fe(+A[n>>3],t))>+fe(+A[a>>3],e)?0|(c=0):0|(c=1))}function tt(t,e){e|=0;var n,r,i,o,s,a=0,u=0,c=0,l=0;return+A[(t|=0)>>3]<+A[e>>3]||+A[t+8>>3]>+A[e+8>>3]?0|(a=0):(i=(o=+A[(a=t+16|0)>>3])<(u=+A[t+24>>3]),c=(l=+A[(n=e+16|0)>>3])<(s=+A[(r=e+24|0)>>3]),e=u-l<s-o,t=i?c|e?1:2:0,e=c?i?1:e?2:1:0,(u=+fe(u,t))<=+fe(+A[r>>3],e)?0|(c=(l=+fe(+A[a>>3],t))>=+fe(+A[n>>3],e)):0|(c=0))}function et(t,e){t|=0,e|=0;var n,r,o,s,a,u=0;o=M,M=M+176|0,i[(r=o)>>2]=4,u=+A[e>>3],A[r+8>>3]=u,s=+A[e+16>>3],A[r+16>>3]=s,A[r+24>>3]=u,u=+A[e+24>>3],A[r+32>>3]=u,a=+A[e+8>>3],A[r+40>>3]=a,A[r+48>>3]=u,A[r+56>>3]=a,A[r+64>>3]=s,n=(e=r+72|0)+96|0;do{i[e>>2]=0,e=e+4|0}while((0|e)<(0|n));yn(0|t,0|r,168),M=o}function nt(t,e,n){t|=0,e|=0,n|=0;var r,s,c,l,f,h,p,d=0,g=0,y=0,_=0,v=0,w=0,E=0;h=M,M=M+288|0,f=h+264|0,_=h+96|0,g=(d=y=h)+96|0;do{i[d>>2]=0,d=d+4|0}while((0|d)<(0|g));return 0|(e=0|oe(e,y))?(M=h,0|(w=e)):(ie(y=0|i[(g=y)>>2],g=0|i[g+4>>2],f),Ae(y,g,_),l=+he(f,_+8|0),A[f>>3]=+A[t>>3],A[(g=f+8|0)>>3]=+A[t+16>>3],A[_>>3]=+A[t+8>>3],A[(y=_+8|0)>>3]=+A[t+24>>3],s=+he(f,_),E=+A[g>>3]-+A[y>>3],c=+u(+E),p=+A[f>>3]-+A[_>>3],r=+u(+p),!(0==E|0==p)&&(E=+pn(+c,+r),E=+m(+s*s/+dn(+E/+dn(+c,+r),3)/(l*(2.59807621135*l)*.8)),A[o>>3]=E,v=~~E>>>0,w=+u(E)>=1?E>0?~~+b(+a(E/4294967296),4294967295)>>>0:~~+m((E-+(~~E>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2])?(_=!(0|v)&!(0|w),i[(e=n)>>2]=_?1:v,i[e+4>>2]=_?0:w,e=0):e=1,M=h,0|(w=e))}function rt(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,l,f,h=0,p=0,d=0;f=M,M=M+288|0,c=f+264|0,l=f+96|0,s=(h=p=f)+96|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|s));return 0|(n=0|oe(n,p))?(M=f,0|(r=n)):(ie(h=0|i[(n=p)>>2],n=0|i[n+4>>2],c),Ae(h,n,l),d=+he(c,l+8|0),d=+m(+ +he(t,e)/(2*d)),A[o>>3]=d,n=~~d>>>0,h=+u(d)>=1?d>0?~~+b(+a(d/4294967296),4294967295)>>>0:~~+m((d-+(~~d>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2]?(p=!(0|n)&!(0|h),i[r>>2]=p?1:n,i[r+4>>2]=p?0:h,M=f,0|(r=0)):(M=f,0|(r=1)))}function it(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function At(t,e){t|=0;var n,r,o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0;i[(s=(e|=0)+8|0)>>2]=0,r=+A[t>>3],f=+u(+r),o=+A[t+8>>3],f+=.5*(h=1.1547005383792515*+u(+o)),f-=+(0|(a=~~f)),h-=+(0|(t=~~h));do{if(f<.5){if(f<.3333333333333333){if(i[e>>2]=a,h<.5*(f+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(h<(d=1-f)))+t|0,i[e+4>>2]=t,d<=h&h<2*f){a=a+1|0,i[e>>2]=a;break}i[e>>2]=a;break}if(!(f<.6666666666666666)){if(a=a+1|0,i[e>>2]=a,h<.5*f){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(h<1-f){if(i[e+4>>2]=t,2*f-1<h){i[e>>2]=a;break}}else t=t+1|0,i[e+4>>2]=t;a=a+1|0,i[e>>2]=a}while(0);do{if(r<0){if(1&t){a=~~(+(0|a)-(2*(+((p=0|nn(0|a,((0|a)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|I()))+1)),i[e>>2]=a;break}a=~~(+(0|a)-2*(+((p=0|nn(0|a,((0|a)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|I()))),i[e>>2]=a;break}}while(0);p=e+4|0,o<0&&(a=a-((1|t<<1)/2|0)|0,i[e>>2]=a,t=0-t|0,i[p>>2]=t),c=t-a|0,(0|a)<0?(l=0-a|0,i[p>>2]=c,i[s>>2]=l,i[e>>2]=0,t=c,a=0):l=0,(0|t)<0&&(a=a-t|0,i[e>>2]=a,l=l-t|0,i[s>>2]=l,i[p>>2]=0,t=0),n=a-l|0,c=t-l|0,(0|l)<0&&(i[e>>2]=n,i[p>>2]=c,i[s>>2]=0,t=c,a=n,l=0),(0|(c=(0|l)<(0|(c=(0|t)<(0|a)?t:a))?l:c))<=0||(i[e>>2]=a-c,i[p>>2]=t-c,i[s>>2]=l-c)}function ot(t){var e,n=0,r=0,A=0,o=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,o=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=o,i[e>>2]=0,r=0):(s=o=t+8|0,o=0|i[o>>2]),(0|o)<0&&(n=n-o|0,i[t>>2]=n,r=r-o|0,i[e>>2]=r,i[s>>2]=0,o=0),(0|(A=(0|o)<(0|(A=(0|r)<(0|n)?r:n))?o:A))<=0||(i[t>>2]=n-A,i[e>>2]=r-A,i[s>>2]=o-A)}function st(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),A[e>>3]=+((0|i[t>>2])-r|0)-.5*n,A[e+8>>3]=.8660254037844386*n}function at(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function ut(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function ct(t,e){e|=0;var n,r=0;r=0|v(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|v(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|v(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function lt(t){var e,n,r=0,A=0,o=0,s=0,a=0;a=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(A=(0|(s=((e=(0|(o=(0|i[t+4>>2])-(a?n:0)|0))<0)?0-o|0:0)+((0|i[t+8>>2])-(a?n:0))|0))<0)?0:s)-((o=(0|(A=(0|t)<(0|(A=(0|(r=(e?0:o)-(A?s:0)|0))<(0|(s=(a?0:n)-(e?o:0)-(A?s:0)|0))?r:s))?t:A))>0)?A:0)|0,r=r-(o?A:0)|0;t:do{switch(s-(o?A:0)|0){case 0:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?1:7:0);case 1:return 0|(a=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(a=7)}function ft(t){var e,n,r=0,A=0,o=0,s=0,a=0,u=0,c=0;if(u=0|i[(n=(t|=0)+8|0)>>2],(e=(0|i[t>>2])-u|0)>>>0>715827881|(u=(0|i[(c=t+4|0)>>2])-u|0)>>>0>715827881){if(s=2147483647-e|0,a=-2147483648-e|0,(o=(0|e)>0)?(0|s)<(0|e):(0|a)>(0|e))return 0|(c=1);if(A=e<<1,o?(2147483647-A|0)<(0|e):(-2147483648-A|0)>(0|e))return 0|(c=1);if((0|u)>0?(2147483647-u|0)<(0|u):(-2147483648-u|0)>(0|u))return 0|(c=1);if(r=3*e|0,A=u<<1,(o?(0|s)<(0|A):(0|a)>(0|A))||((0|e)>-1?(-2147483648|r)>=(0|u):(-2147483648^r)<(0|u)))return 0|(c=1)}else A=u<<1,r=3*e|0;return o=0|Ke(.14285714285714285*+(r-u|0)),i[t>>2]=o,s=0|Ke(.14285714285714285*+(A+e|0)),i[c>>2]=s,i[n>>2]=0,r=(A=(0|s)<(0|o))?o:s,(0|(A=A?s:o))<0&&((-2147483648==(0|A)||((0|r)>0?(2147483647-r|0)<(0|A):(-2147483648-r|0)>(0|A)))&&x(27795,26892,354,26903),((0|r)>-1?(-2147483648|r)>=(0|A):(-2147483648^r)<(0|A))&&x(27795,26892,354,26903)),r=s-o|0,(0|o)<0?(A=0-o|0,i[c>>2]=r,i[n>>2]=A,i[t>>2]=0,o=0):(r=s,A=0),(0|r)<0&&(o=o-r|0,i[t>>2]=o,A=A-r|0,i[n>>2]=A,i[c>>2]=0,r=0),a=o-A|0,s=r-A|0,(0|A)<0?(i[t>>2]=a,i[c>>2]=s,i[n>>2]=0,r=s,s=a,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|r)<(0|s)?r:s))?A:o))<=0||(i[t>>2]=s-o,i[c>>2]=r-o,i[n>>2]=A-o),0|(c=0)}function ht(t){var e,n=0,r=0,A=0,o=0,s=0,a=0,u=0;if(o=0|i[(e=(t|=0)+8|0)>>2],(s=(0|i[t>>2])-o|0)>>>0>715827881|(o=(0|i[(a=t+4|0)>>2])-o|0)>>>0>715827881){if((r=(0|s)>0)?(2147483647-s|0)<(0|s):(-2147483648-s|0)>(0|s))return 0|(a=1);if(n=s<<1,(A=(0|o)>0)?(2147483647-o|0)<(0|o):(-2147483648-o|0)>(0|o))return 0|(a=1);if(u=o<<1,A?(2147483647-u|0)<(0|o):(-2147483648-u|0)>(0|o))return 0|(u=1);if(r?(2147483647-n|0)<(0|o):(-2147483648-n|0)>(0|o))return 0|(u=1);if(r=3*o|0,(0|o)>-1?(-2147483648|r)>=(0|s):(-2147483648^r)<(0|s))return 0|(u=1)}else r=3*o|0,n=s<<1;return A=0|Ke(.14285714285714285*+(n+o|0)),i[t>>2]=A,o=0|Ke(.14285714285714285*+(r-s|0)),i[a>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|A))?A:o,(0|(r=r?o:A))<0&&((-2147483648==(0|r)||((0|n)>0?(2147483647-n|0)<(0|r):(-2147483648-n|0)>(0|r)))&&x(27795,26892,402,26917),((0|n)>-1?(-2147483648|n)>=(0|r):(-2147483648^n)<(0|r))&&x(27795,26892,402,26917)),n=o-A|0,(0|A)<0?(r=0-A|0,i[a>>2]=n,i[e>>2]=r,i[t>>2]=0,A=0):(n=o,r=0),(0|n)<0&&(A=A-n|0,i[t>>2]=A,r=r-n|0,i[e>>2]=r,i[a>>2]=0,n=0),s=A-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[a>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=A,(0|(A=(0|r)<(0|(A=(0|n)<(0|o)?n:o))?r:A))<=0||(i[t>>2]=o-A,i[a>>2]=n-A,i[e>>2]=r-A),0|(u=0)}function pt(t){var e,n,r=0,A=0,o=0,s=0,a=0;A=0|i[(e=(t|=0)+8|0)>>2],o=0|Ke(.14285714285714285*+((3*(r=(0|i[t>>2])-A|0)|0)-(A=(0|i[(n=t+4|0)>>2])-A|0)|0)),i[t>>2]=o,r=0|Ke(.14285714285714285*+((A<<1)+r|0)),i[n>>2]=r,i[e>>2]=0,A=r-o|0,(0|o)<0?(a=0-o|0,i[n>>2]=A,i[e>>2]=a,i[t>>2]=0,r=A,o=0,A=a):A=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,A=A-r|0,i[e>>2]=A,i[n>>2]=0,r=0),a=o-A|0,s=r-A|0,(0|A)<0?(i[t>>2]=a,i[n>>2]=s,i[e>>2]=0,r=s,s=a,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|r)<(0|s)?r:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=A-o)}function dt(t){var e,n,r=0,A=0,o=0,s=0,a=0;A=0|i[(e=(t|=0)+8|0)>>2],o=0|Ke(.14285714285714285*+(((r=(0|i[t>>2])-A|0)<<1)+(A=(0|i[(n=t+4|0)>>2])-A|0)|0)),i[t>>2]=o,r=0|Ke(.14285714285714285*+((3*A|0)-r|0)),i[n>>2]=r,i[e>>2]=0,A=r-o|0,(0|o)<0?(a=0-o|0,i[n>>2]=A,i[e>>2]=a,i[t>>2]=0,r=A,o=0,A=a):A=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,A=A-r|0,i[e>>2]=A,i[n>>2]=0,r=0),a=o-A|0,s=r-A|0,(0|A)<0?(i[t>>2]=a,i[n>>2]=s,i[e>>2]=0,r=s,s=a,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|r)<(0|s)?r:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=A-o)}function gt(t){var e,n,r,A=0,o=0,s=0,a=0;A=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],a=o+(3*A|0)|0,i[t>>2]=a,o=s+(3*o|0)|0,i[n>>2]=o,A=(3*s|0)+A|0,i[r>>2]=A,s=o-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=s,i[r>>2]=A,i[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function yt(t){var e,n,r,A=0,o=0,s=0,a=0;a=0|i[(t|=0)>>2],s=(3*(A=0|i[(n=t+4|0)>>2])|0)+a|0,a=(o=0|i[(r=t+8|0)>>2])+(3*a|0)|0,i[t>>2]=a,i[n>>2]=s,A=(3*o|0)+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,i[t>>2]=a,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=a-A|0,s=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,a=e,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|s)<(0|a)?s:a))?A:o))<=0||(i[t>>2]=a-o,i[n>>2]=s-o,i[r>>2]=A-o)}function _t(t,e){t|=0;var n,r,A,o=0,s=0,a=0;((e|=0)+-1|0)>>>0>=6||(a=(0|i[15440+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=a,A=t+4|0,s=(0|i[15440+(12*e|0)+4>>2])+(0|i[A>>2])|0,i[A>>2]=s,r=t+8|0,e=(0|i[15440+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,o=s-a|0,(0|a)<0?(e=e-a|0,i[A>>2]=o,i[r>>2]=e,i[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,i[t>>2]=s,e=e-o|0,i[r>>2]=e,i[A>>2]=0,o=0),n=s-e|0,a=o-e|0,(0|e)<0?(i[t>>2]=n,i[A>>2]=a,i[r>>2]=0,s=n,e=0):a=o,(0|(o=(0|e)<(0|(o=(0|a)<(0|s)?a:s))?e:o))<=0||(i[t>>2]=s-o,i[A>>2]=a-o,i[r>>2]=e-o))}function mt(t){var e,n,r,A=0,o=0,s=0,a=0;a=0|i[(t|=0)>>2],s=(A=0|i[(n=t+4|0)>>2])+a|0,a=(o=0|i[(r=t+8|0)>>2])+a|0,i[t>>2]=a,i[n>>2]=s,A=o+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function vt(t){var e,n,r,A=0,o=0,s=0,a=0;A=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],o=0|i[(r=t+8|0)>>2],a=s+A|0,i[t>>2]=a,s=o+s|0,i[n>>2]=s,A=o+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function bt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function wt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function Et(t){var e,n,r,A=0,o=0,s=0,a=0;A=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],a=o+(A<<1)|0,i[t>>2]=a,o=s+(o<<1)|0,i[n>>2]=o,A=(s<<1)+A|0,i[r>>2]=A,s=o-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=s,i[r>>2]=A,i[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,i[t>>2]=s,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=s-A|0,a=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=a,i[r>>2]=0,s=e,A=0):a=o,(0|(o=(0|A)<(0|(o=(0|a)<(0|s)?a:s))?A:o))<=0||(i[t>>2]=s-o,i[n>>2]=a-o,i[r>>2]=A-o)}function Ct(t){var e,n,r,A=0,o=0,s=0,a=0;a=0|i[(t|=0)>>2],s=((A=0|i[(n=t+4|0)>>2])<<1)+a|0,a=(o=0|i[(r=t+8|0)>>2])+(a<<1)|0,i[t>>2]=a,i[n>>2]=s,A=(o<<1)+A|0,i[r>>2]=A,o=s-a|0,(0|a)<0?(A=A-a|0,i[n>>2]=o,i[r>>2]=A,i[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,i[t>>2]=a,A=A-o|0,i[r>>2]=A,i[n>>2]=0,o=0),e=a-A|0,s=o-A|0,(0|A)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,a=e,A=0):s=o,(0|(o=(0|A)<(0|(o=(0|s)<(0|a)?s:a))?A:o))<=0||(i[t>>2]=a-o,i[n>>2]=s-o,i[r>>2]=A-o)}function It(t,e){e|=0;var n,r,A,o=0,s=0,a=0;return A=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(A?r:0)|0))<0,e=(e=(t=(0|(a=(A?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:a)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?a:0)|0))<(0|(a=(A?0:r)-(n?s:0)-(t?a:0)|0))?o:a))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=a-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function xt(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function St(t,e){e|=0;var n,r,A,o=0,s=0,a=0;if(s=0|i[(t|=0)>>2],i[e>>2]=s,a=0|i[t+4>>2],i[(r=e+4|0)>>2]=a,i[(A=e+8|0)>>2]=0,t=(o=(0|a)<(0|s))?s:a,(0|(o=o?a:s))<0){if(-2147483648==(0|o)||((0|t)>0?(2147483647-t|0)<(0|o):(-2147483648-t|0)>(0|o)))return 0|(e=1);if((0|t)>-1?(-2147483648|t)>=(0|o):(-2147483648^t)<(0|o))return 0|(e=1)}return t=a-s|0,(0|s)<0?(o=0-s|0,i[r>>2]=t,i[A>>2]=o,i[e>>2]=0,s=0):(t=a,o=0),(0|t)<0&&(s=s-t|0,i[e>>2]=s,o=o-t|0,i[A>>2]=o,i[r>>2]=0,t=0),n=s-o|0,a=t-o|0,(0|o)<0?(i[e>>2]=n,i[r>>2]=a,i[A>>2]=0,t=a,a=n,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|a)?t:a))?o:s))<=0||(i[e>>2]=a-s,i[r>>2]=t-s,i[A>>2]=o-s),0|(e=0)}function Nt(t){var e,n,r,A;n=(A=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-A|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function Dt(t){var e,n,r=0,A=0,o=0,s=0,a=0;r=0-(A=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(o=0|i[(n=t+4|0)>>2])+A|0,(0|A)>0?(i[n>>2]=s,i[e>>2]=A,i[t>>2]=0,r=0,o=s):A=0,(0|o)<0?(a=r-o|0,i[t>>2]=a,A=A-o|0,i[e>>2]=A,i[n>>2]=0,s=a-A|0,r=0-A|0,(0|A)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,o=r,A=0):(o=0,s=a)):s=r,(0|(r=(0|A)<(0|(r=(0|o)<(0|s)?o:s))?A:r))<=0||(i[t>>2]=s-r,i[n>>2]=o-r,i[e>>2]=A-r)}function Lt(t,e){var n=0;switch(n=0|ln(0|(t|=0),0|(e|=0),56),I(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|jt(t,n))?0|(n=0):0|(n=0|zt(t,n)):0|(n=0)}function Tt(t,e,n){n|=0;var r,A,o=0,s=0;return A=M,M=M+16|0,r=A,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|ln(0|(t|=0),0|e,56),I(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,A=0,o=0;if(o=M,M=M+16|0,A=o,r=0|jt(t,e),(n+-1|0)>>>0>5)return M=o,0|(A=-1);if(r=!!(0|r),1==(0|n)&r)return M=o,0|(A=-1);do{if(!(0|Qe(t,e,A))){if(r){r=(5+(0|i[26352+(n<<2)>>2])-(0|i[A>>2])|0)%5|0;break}r=(6+(0|i[26384+(n<<2)>>2])-(0|i[A>>2])|0)%6|0;break}r=-1}while(0);return A=r,M=o,0|A}(t,s,7&o),-1==(0|o)?(i[n>>2]=0,M=A,0|(s=6)):(0|re(t,s,r)&&x(27795,26932,282,26947),e=0|ln(0|t,0|e,52),I(),e&=15,0|jt(t,s)?Rt(r,e,o,2,n):Gt(r,e,o,2,n),M=A,0|(s=0))):(M=A,0|(s=6))}function Mt(t,e,n,r){e|=0,r|=0;var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=M,M=M+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+A[t>>3],r=+f(+n),n=+h(+n),A[e+16>>3]=n,n=+A[t+8>>3],i=r*+f(+n),A[e>>3]=i,n=r*+h(+n),A[e+8>>3]=n}(t,o),i[e>>2]=0,A[n>>3]=5,r=+Ue(16400,o),r<+A[n>>3]&&(i[e>>2]=0,A[n>>3]=r);r=+Ue(16424,o),r<+A[n>>3]&&(i[e>>2]=1,A[n>>3]=r);r=+Ue(16448,o),r<+A[n>>3]&&(i[e>>2]=2,A[n>>3]=r);r=+Ue(16472,o),r<+A[n>>3]&&(i[e>>2]=3,A[n>>3]=r);r=+Ue(16496,o),r<+A[n>>3]&&(i[e>>2]=4,A[n>>3]=r);r=+Ue(16520,o),r<+A[n>>3]&&(i[e>>2]=5,A[n>>3]=r);r=+Ue(16544,o),r<+A[n>>3]&&(i[e>>2]=6,A[n>>3]=r);r=+Ue(16568,o),r<+A[n>>3]&&(i[e>>2]=7,A[n>>3]=r);r=+Ue(16592,o),r<+A[n>>3]&&(i[e>>2]=8,A[n>>3]=r);r=+Ue(16616,o),r<+A[n>>3]&&(i[e>>2]=9,A[n>>3]=r);r=+Ue(16640,o),r<+A[n>>3]&&(i[e>>2]=10,A[n>>3]=r);r=+Ue(16664,o),r<+A[n>>3]&&(i[e>>2]=11,A[n>>3]=r);r=+Ue(16688,o),r<+A[n>>3]&&(i[e>>2]=12,A[n>>3]=r);r=+Ue(16712,o),r<+A[n>>3]&&(i[e>>2]=13,A[n>>3]=r);r=+Ue(16736,o),r<+A[n>>3]&&(i[e>>2]=14,A[n>>3]=r);r=+Ue(16760,o),r<+A[n>>3]&&(i[e>>2]=15,A[n>>3]=r);r=+Ue(16784,o),r<+A[n>>3]&&(i[e>>2]=16,A[n>>3]=r);r=+Ue(16808,o),r<+A[n>>3]&&(i[e>>2]=17,A[n>>3]=r);r=+Ue(16832,o),r<+A[n>>3]&&(i[e>>2]=18,A[n>>3]=r);if(r=+Ue(16856,o),!(r<+A[n>>3]))return void(M=s);i[e>>2]=19,A[n>>3]=r,M=s}(t|=0,n|=0,c=o),(a=+d(+(1-.5*+A[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(M=o);if(c=0|i[n>>2],s=+ce((s=+A[15920+(24*c|0)>>3])-+ce(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,o=0,s=0;return o=+A[e>>3],r=+f(+o),i=+A[e+8>>3]-+A[t+8>>3],s=r*+h(+i),n=+A[t>>3],+ +_(+s,+(+h(+o)*+f(+n)-+f(+i)*(r*+h(+n))))}(15600+(c<<4)|0,t))),u=0|te(e)?+ce(s+-.3334731722518321):s,s=2.618033988749896*+p(+a),(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}a=+f(+u)*s,A[r>>3]=a,u=+h(+u)*s,A[r+8>>3]=u,M=o}function Ot(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s,a=0,l=0;if(a=+function(t){t|=0;var e=0,n=0;return n=+A[t>>3],e=+A[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),a<1e-16)return e=15600+(e<<4)|0,i[o>>2]=i[e>>2],i[o+4>>2]=i[e+4>>2],i[o+8>>2]=i[e+8>>2],void(i[o+12>>2]=i[e+12>>2]);if(l=+_(+ +A[t+8>>3],+ +A[t>>3]),(0|n)>0){t=0;do{a*=.37796447300922725,t=t+1|0}while((0|t)!=(0|n))}s=.3333333333333333*a,r?(n=!(0|te(n)),a=+y(.381966011250105*(n?s:.37796447300922725*s))):(a=+y(.381966011250105*a),0|te(n)&&(l=+ce(l+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,a=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+u(+(s+-3.141592653589793))<1e-16,e=+A[t>>3],o){e-=n,A[r>>3]=e,o=r;break}if(a=+f(+n),n=+h(+n),e=a*+h(+e)+ +f(+s)*(n*+f(+e)),e=+g(+((e=e>1?1:e)<-1?-1:e)),A[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return A[r>>3]=1.5707963267948966,void(A[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return A[r>>3]=-1.5707963267948966,void(A[r+8>>3]=0);if(c=1/+f(+e),s=n*+h(+s)*c,n=+A[t>>3],e=c*((a-+h(+e)*+h(+n))/+f(+n)),a=s>1?1:s,e=e>1?1:e,(e=+A[t+8>>3]+ +_(+(a<-1?-1:a),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(A[r+8>>3]=e)}e=+A[t>>3]+n,A[r>>3]=e,o=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return A[o>>3]=1.5707963267948966,void(A[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return A[o>>3]=-1.5707963267948966,void(A[r+8>>3]=0);if(e=+A[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);A[r+8>>3]=e}(15600+(e<<4)|0,+ce(+A[15920+(24*e|0)>>3]-l),a,o)}function Pt(t,e,n){e|=0,n|=0;var r,A;r=M,M=M+16|0,st((t|=0)+4|0,A=r),Ot(A,0|i[t>>2],e,0,n),M=r}function Rt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,b,w,E,C,I,S,N,D,L=0,T=0,O=0,P=0,R=0,k=0;if(D=M,M=M+272|0,P=D+240|0,I=D,S=D+224|0,N=D+208|0,y=D+176|0,_=D+160|0,m=D+192|0,v=D+144|0,b=D+128|0,w=D+112|0,E=D+96|0,C=D+80|0,i[(L=D+256|0)>>2]=e,i[P>>2]=i[t>>2],i[P+4>>2]=i[t+4>>2],i[P+8>>2]=i[t+8>>2],i[P+12>>2]=i[t+12>>2],kt(P,L,I),i[o>>2]=0,(0|(P=r+n+(5==(0|r)&1)|0))<=(0|n))M=D;else{a=S+4|0,u=y+4|0,c=n+5|0,l=16880+((s=0|i[L>>2])<<2)|0,f=16960+(s<<2)|0,h=b+8|0,p=w+8|0,d=E+8|0,g=N+4|0,O=n;t:for(;;){T=I+((0|O)%5<<4)|0,i[N>>2]=i[T>>2],i[N+4>>2]=i[T+4>>2],i[N+8>>2]=i[T+8>>2],i[N+12>>2]=i[T+12>>2];do{}while(2==(0|Bt(N,s,0,1)));if((0|O)>(0|n)&!!(0|te(e))){if(i[y>>2]=i[N>>2],i[y+4>>2]=i[N+4>>2],i[y+8>>2]=i[N+8>>2],i[y+12>>2]=i[N+12>>2],st(a,_),r=0|i[y>>2],L=0|i[17040+(80*r|0)+(i[S>>2]<<2)>>2],i[y>>2]=i[18640+(80*r|0)+(20*L|0)>>2],(0|(T=0|i[18640+(80*r|0)+(20*L|0)+16>>2]))>0){t=0;do{mt(u),t=t+1|0}while((0|t)<(0|T))}switch(T=18640+(80*r|0)+(20*L|0)+4|0,i[m>>2]=i[T>>2],i[m+4>>2]=i[T+4>>2],i[m+8>>2]=i[T+8>>2],ct(m,3*(0|i[l>>2])|0),at(u,m,u),ot(u),st(u,v),R=+(0|i[f>>2]),A[b>>3]=3*R,A[h>>3]=0,k=-1.5*R,A[w>>3]=k,A[p>>3]=2.598076211353316*R,A[E>>3]=k,A[d>>3]=-2.598076211353316*R,0|i[17040+(80*(0|i[y>>2])|0)+(i[N>>2]<<2)>>2]){case 1:t=w,r=b;break;case 3:t=E,r=w;break;case 2:t=b,r=E;break;default:t=12;break t}Fe(_,v,r,t,C),Ot(C,0|i[y>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])}if((0|O)<(0|c)&&(st(g,y),Ot(y,0|i[N>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),i[S>>2]=i[N>>2],i[S+4>>2]=i[N+4>>2],i[S+8>>2]=i[N+8>>2],i[S+12>>2]=i[N+12>>2],(0|(O=O+1|0))>=(0|P)){t=3;break}}3!=(0|t)?12==(0|t)&&x(26970,27017,572,27027):M=D}}function kt(t,e,n){t|=0,e|=0,n|=0;var r,A=0,o=0,s=0,a=0,u=0;r=M,M=M+128|0,o=r,a=20240,u=(s=A=r+64|0)+60|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20304,u=(s=o)+60|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));A=(u=!(0|te(0|i[e>>2])))?A:o,Et(o=t+4|0),Ct(o),0|te(0|i[e>>2])&&(yt(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],at(o,A,e=n+4|0),ot(e),i[n+16>>2]=i[t>>2],at(o,A+12|0,e=n+20|0),ot(e),i[n+32>>2]=i[t>>2],at(o,A+24|0,e=n+36|0),ot(e),i[n+48>>2]=i[t>>2],at(o,A+36|0,e=n+52|0),ot(e),i[n+64>>2]=i[t>>2],at(o,A+48|0,n=n+68|0),ot(n),M=r}function Bt(t,e,n,r){n|=0,r|=0;var A,o,s,a,u,c,l=0,f=0,h=0,p=0,d=0;if(c=M,M=M+32|0,u=c+12|0,o=c,d=(t|=0)+4|0,p=0|i[16960+((e|=0)<<2)>>2],p=(a=!!(0|r))?3*p|0:p,l=0|i[d>>2],A=0|i[(s=t+8|0)>>2],a){if((0|(l=A+l+(r=0|i[(f=t+12|0)>>2])|0))==(0|p))return M=c,0|(d=1);h=f}else l=A+l+(r=0|i[(h=t+12|0)>>2])|0;if((0|l)<=(0|p))return M=c,0|(d=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|A)>0){f=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(it(u,p,0,0),ut(d,u,o),vt(o),at(o,u,d),f=r,r=t):(f=r,r=t)}else f=18640+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[f>>2],(0|i[(l=f+16|0)>>2])>0){r=0;do{mt(d),r=r+1|0}while((0|r)<(0|i[l>>2]))}return t=f+4|0,i[u>>2]=i[t>>2],i[u+4>>2]=i[t+4>>2],i[u+8>>2]=i[t+8>>2],e=0|i[16880+(e<<2)>>2],ct(u,a?3*e|0:e),at(d,u,d),ot(d),r=a&&((0|i[s>>2])+(0|i[d>>2])+(0|i[h>>2])|0)==(0|p)?1:2,M=c,0|(d=r)}function Ft(t,e){t|=0,e|=0;var n=0;do{n=0|Bt(t,e,0,1)}while(2==(0|n));return 0|n}function Gt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,b,w,E,C,I=0,S=0,N=0,D=0,L=0;if(C=M,M=M+240|0,v=C+208|0,b=C,w=C+192|0,E=C+176|0,d=C+160|0,g=C+144|0,y=C+128|0,_=C+112|0,m=C+96|0,i[(I=C+224|0)>>2]=e,i[v>>2]=i[t>>2],i[v+4>>2]=i[t+4>>2],i[v+8>>2]=i[t+8>>2],i[v+12>>2]=i[t+12>>2],Ut(v,I,b),i[o>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))M=C;else{a=n+6|0,u=16960+((s=0|i[I>>2])<<2)|0,c=g+8|0,l=y+8|0,f=_+8|0,h=w+4|0,S=0,N=n,r=-1;t:for(;;){if(t=b+((I=(0|N)%6|0)<<4)|0,i[w>>2]=i[t>>2],i[w+4>>2]=i[t+4>>2],i[w+8>>2]=i[t+8>>2],i[w+12>>2]=i[t+12>>2],t=S,S=0|Bt(w,s,0,1),(0|N)>(0|n)&!!(0|te(e))&&(1!=(0|t)&&(0|i[w>>2])!=(0|r))){switch(st(b+((I+5|0)%6<<4)+4|0,E),st(b+(I<<4)+4|0,d),D=+(0|i[u>>2]),A[g>>3]=3*D,A[c>>3]=0,L=-1.5*D,A[y>>3]=L,A[l>>3]=2.598076211353316*D,A[_>>3]=L,A[f>>3]=-2.598076211353316*D,I=0|i[v>>2],0|i[17040+(80*I|0)+(((0|r)==(0|I)?i[w>>2]:r)<<2)>>2]){case 1:t=y,r=g;break;case 3:t=_,r=y;break;case 2:t=g,r=_;break;default:t=8;break t}Fe(E,d,r,t,m),0|Ge(E,m)||0|Ge(d,m)||(Ot(m,0|i[v>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]))}if((0|N)<(0|a)&&(st(h,E),Ot(E,0|i[w>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),(0|(N=N+1|0))>=(0|p)){t=3;break}r=0|i[w>>2]}3!=(0|t)?8==(0|t)&&x(27054,27017,737,27099):M=C}}function Ut(t,e,n){t|=0,e|=0,n|=0;var r,A=0,o=0,s=0,a=0,u=0;r=M,M=M+160|0,o=r,a=20368,u=(s=A=r+80|0)+72|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20448,u=(s=o)+72|0;do{i[s>>2]=i[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));A=(u=!(0|te(0|i[e>>2])))?A:o,Et(o=t+4|0),Ct(o),0|te(0|i[e>>2])&&(yt(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],at(o,A,e=n+4|0),ot(e),i[n+16>>2]=i[t>>2],at(o,A+12|0,e=n+20|0),ot(e),i[n+32>>2]=i[t>>2],at(o,A+24|0,e=n+36|0),ot(e),i[n+48>>2]=i[t>>2],at(o,A+36|0,e=n+52|0),ot(e),i[n+64>>2]=i[t>>2],at(o,A+48|0,e=n+68|0),ot(e),i[n+80>>2]=i[t>>2],at(o,A+60|0,n=n+84|0),ot(n),M=r}function Qt(t,e){return e=0|ln(0|(t|=0),0|(e|=0),45),I(),127&e}function zt(t,e){t|=0;var n=0,i=0,A=0,o=0;return!0&134217728==(-16777216&(e|=0))?(i=0|ln(0|t,0|e,52),I(),i&=15,n=0|ln(0|t,0|e,45),I(),(n&=127)>>>0>121?0|(t=0):!(613566756&(o=0|fn(0|(A=0|ln(0|t,0|e,0|(o=3*(15^i)|0))),0|I(),0|o))&(0|nn(-1227133514,-1171,0|o,0|(A=0|I()))))&!(4681&A&I())&&15==(0|i)|!(0|(o=0|ln(0|(0|fn(0|~t,0|~e,0|(o=19+(3*i|0)|0))),0|I(),0|o)))&!(0|I())?0|r[20528+n|0]?!(0|t)&!(0|(e&=8191))?0|(o=1):(o=0|hn(0|t,0|e),I(),0|!!((63-o|0)%3|0)):0|(o=1):0|(o=0)):0|(t=0)}function qt(t,e,n,r){t|=0,n|=0,r|=0;var A=0,o=0,s=0,a=0;if(A=0|fn(0|(e|=0),0,52),o=0|I(),n=0|fn(0|n,0,45),n=0|o|I()|134225919,(0|e)<1)return o=-1,r=n,i[(e=t)>>2]=o,void(i[(t=t+4|0)>>2]=r);for(o=1,A=-1;a=0|fn(7,0,0|(s=3*(15-o|0)|0)),n&=~I(),A=A&~a|(s=0|fn(0|r,0,0|s)),n=0|n|I(),(0|o)!=(0|e);)o=o+1|0;i[(s=a=t)>>2]=A,i[(a=a+4|0)>>2]=n}function Vt(t,e,n,r){n|=0,r|=0;var A=0,o=0;if(o=0|ln(0|(t|=0),0|(e|=0),52),I(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return i[r>>2]=t,i[r+4>>2]=e,0|(r=0);if(A=0|fn(0|n,0,52),A|=t,t=I()|-15728641&e,(0|o)>(0|n))do{e=0|fn(7,0,3*(14-n|0)|0),n=n+1|0,A|=e,t=0|I()|t}while((0|n)<(0|o));return i[r>>2]=A,i[r+4>>2]=t,0|(r=0)}function Yt(t,e,n,r){n|=0,r|=0;var A=0,o=0,s=0;if(o=0|ln(0|(t|=0),0|(e|=0),52),I(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);A=n-o|0,n=0|ln(0|t,0|e,45),I();t:do{if(0|z(127&n)){e:do{if(0|o){for(n=1;!((s=0|fn(7,0,3*(15-n|0)|0))&t|0)&!((0|I())&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|Ie(7,0,A,((0|A)<0)<<31>>31),A=0|I();break t}}while(0);n=0|en(0|(n=0|sn(0|(n=0|Ie(7,0,A,((0|A)<0)<<31>>31)),0|I(),5,0)),0|I(),-5,-1),n=0|en(0|(n=0|on(0|n,0|I(),6,0)),0|I(),1,0),A=0|I()}else n=0|Ie(7,0,A,((0|A)<0)<<31>>31),A=0|I()}while(0);return i[(s=r)>>2]=n,i[s+4>>2]=A,0|(s=0)}function jt(t,e){var n=0,r=0,i=0;if(i=0|ln(0|(t|=0),0|(e|=0),45),I(),!(0|z(127&i)))return 0|(i=0);i=0|ln(0|t,0|e,52),I(),i&=15;t:do{if(i)for(r=1;;){if(n=0|ln(0|t,0|e,3*(15-r|0)|0),I(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=1&!(0|n))}function Ht(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,C(0|(n=e)),0|r):(n=0|fn(-1,-1,3+(3*(r-n|0)|0)|0),r=0|fn(0|~n,0|~I(),3*(15-r|0)|0),n=~I()&e,r=~r&t,C(0|n),0|r)}function Xt(t,e,n,r){n|=0,r|=0;var A=0;return A=0|ln(0|(t|=0),0|(e|=0),52),I(),(0|n)<16&(0|(A&=15))<=(0|n)?((0|A)<(0|n)&&(A=0|fn(-1,-1,3+(3*(n+-1-A|0)|0)|0),A=0|fn(0|~A,0|~I(),3*(15-n|0)|0),e=~I()&e,t&=~A),A=0|fn(0|n,0,52),n=-15728641&e|I(),i[r>>2]=t|A,i[r+4>>2]=n,0|(r=0)):0|(r=4)}function Wt(t,e){var n=0,r=0,i=0;if(i=0|ln(0|(t|=0),0|(e|=0),52),I(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|ln(0|t,0|e,3*(15-r|0)|0),I(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function $t(t,e){var n=0,r=0,i=0,A=0,o=0,s=0,a=0;if(a=0|ln(0|(t|=0),0|(e|=0),52),I(),!(a&=15))return a=t,C(0|(s=e)),0|a;for(s=1,n=0;;){r=0|fn(7,0,0|(A=3*(15-s|0)|0)),i=0|I(),o=0|ln(0|t,0|e,0|A),I(),t=(A=0|fn(0|bt(7&o),0,0|A))|t&~r,e=(o=0|I())|e&~i;t:do{if(!n)if(!(A&r|0)&!(o&i|0))n=0;else if(r=0|ln(0|t,0|e,52),I(),r&=15){n=1;e:for(;;){switch(o=0|ln(0|t,0|e,3*(15-n|0)|0),I(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ln(0|t,0|e,0|(o=3*(15-n|0)|0)),I(),A=0|fn(7,0,0|o),e&=~I(),t=t&~A|(o=0|fn(0|bt(7&i),0,0|o)),e=0|e|I(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return C(0|e),0|t}function Kt(t,e){var n=0,r=0,i=0,A=0,o=0;if(r=0|ln(0|(t|=0),0|(e|=0),52),I(),!(r&=15))return r=t,C(0|(n=e)),0|r;for(n=1;o=0|ln(0|t,0|e,0|(A=3*(15-n|0)|0)),I(),i=0|fn(7,0,0|A),e&=~I(),t=(A=0|fn(0|bt(7&o),0,0|A))|t&~i,e=0|I()|e,n>>>0<r>>>0;)n=n+1|0;return C(0|e),0|t}function Jt(t,e){var n=0,r=0,i=0,A=0,o=0,s=0,a=0;if(a=0|ln(0|(t|=0),0|(e|=0),52),I(),!(a&=15))return a=t,C(0|(s=e)),0|a;for(s=1,n=0;;){r=0|fn(7,0,0|(A=3*(15-s|0)|0)),i=0|I(),o=0|ln(0|t,0|e,0|A),I(),t=(A=0|fn(0|wt(7&o),0,0|A))|t&~r,e=(o=0|I())|e&~i;t:do{if(!n)if(!(A&r|0)&!(o&i|0))n=0;else if(r=0|ln(0|t,0|e,52),I(),r&=15){n=1;e:for(;;){switch(o=0|ln(0|t,0|e,3*(15-n|0)|0),I(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(A=0|fn(7,0,0|(i=3*(15-n|0)|0)),o=e&~I(),e=0|ln(0|t,0|e,0|i),I(),t=t&~A|(e=0|fn(0|wt(7&e),0,0|i)),e=0|o|I(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return C(0|e),0|t}function Zt(t,e){var n=0,r=0,i=0,A=0,o=0;if(r=0|ln(0|(t|=0),0|(e|=0),52),I(),!(r&=15))return r=t,C(0|(n=e)),0|r;for(n=1;A=0|fn(7,0,0|(o=3*(15-n|0)|0)),i=e&~I(),e=0|ln(0|t,0|e,0|o),I(),t=(e=0|fn(0|wt(7&e),0,0|o))|t&~A,e=0|I()|i,n>>>0<r>>>0;)n=n+1|0;return C(0|e),0|t}function te(t){return(0|(t|=0))%2|0}function ee(t,e,n){n|=0;var r,A=0;return r=M,M=M+16|0,A=r,(e|=0)>>>0>15?(M=r,0|(A=4)):2146435072&~i[(t|=0)+4>>2]&&2146435072&~i[t+8+4>>2]?(function(t,e,n){var r,i;r=M,M=M+16|0,Mt(t|=0,e|=0,n|=0,i=r),At(i,n+4|0),M=r}(t,e,A),e=0|function(t,e){t|=0;var n,r=0,A=0,o=0,s=0,a=0,u=0,c=0,l=0;if(n=M,M=M+64|0,u=n+40|0,A=n+24|0,o=n+12|0,s=n,fn(0|(e|=0),0,52),r=134225919|I(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(u=0,C(0|(a=0)),M=n,0|u):(fn(0|V(t),0,45),a=0|I()|r,u=-1,C(0|a),M=n,0|u);if(i[u>>2]=i[t>>2],i[u+4>>2]=i[t+4>>2],i[u+8>>2]=i[t+8>>2],i[u+12>>2]=i[t+12>>2],a=u+4|0,(0|e)>0)for(t=-1;i[A>>2]=i[a>>2],i[A+4>>2]=i[a+4>>2],i[A+8>>2]=i[a+8>>2],1&e?(pt(a),i[o>>2]=i[a>>2],i[o+4>>2]=i[a+4>>2],i[o+8>>2]=i[a+8>>2],gt(o)):(dt(a),i[o>>2]=i[a>>2],i[o+4>>2]=i[a+4>>2],i[o+8>>2]=i[a+8>>2],yt(o)),ut(A,o,s),ot(s),c=0|fn(7,0,0|(l=3*(15-e|0)|0)),r&=~I(),t=(l=0|fn(0|lt(s),0,0|l))|t&~c,r=0|I()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[a>>2])<=2&&(0|i[u+8>>2])<=2&&(0|i[u+12>>2])<=2){if(e=0|fn(0|(A=0|V(u)),0,45),e|=t,t=I()|-1040385&r,s=0|Y(u),!(0|z(A))){if((0|s)<=0)break;for(o=0;;){if(A=0|ln(0|e,0|t,52),I(),A&=15)for(r=1;u=0|ln(0|e,0|t,0|(l=3*(15-r|0)|0)),I(),c=0|fn(7,0,0|l),t&=~I(),e=e&~c|(l=0|fn(0|bt(7&u),0,0|l)),t=0|t|I(),r>>>0<A>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|ln(0|e,0|t,52),I(),o&=15;e:do{if(o){r=1;n:for(;;){switch(l=0|ln(0|e,0|t,3*(15-r|0)|0),I(),7&l){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|j(A,0|i[u>>2]))for(r=1;c=0|fn(7,0,0|(u=3*(15-r|0)|0)),l=t&~I(),t=0|ln(0|e,0|t,0|u),I(),e=e&~c|(t=0|fn(0|wt(7&t),0,0|u)),t=0|l|I(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;u=0|ln(0|e,0|t,0|(l=3*(15-r|0)|0)),I(),c=0|fn(7,0,0|l),t&=~I(),e=e&~c|(l=0|fn(0|bt(7&u),0,0|l)),t=0|t|I(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|$t(e,t),t=0|I(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return l=e,C(0|(c=t)),M=n,0|l}(A,e),A=0|I(),i[n>>2]=e,i[n+4>>2]=A,!(0|e)&!(0|A)&&x(27795,27122,1050,27145),M=r,0|(A=0)):(M=r,0|(A=3))}function ne(t,e,n){var r,A=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|ln(0|(t|=0),0|(e|=0),52),I(),o&=15,s=0|ln(0|t,0|e,45),I(),A=!(0|o),0|z(127&s)){if(A)return 0|(s=1);A=1}else{if(A)return 0|(s=0);A=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2])}for(n=1;1&n?gt(r):yt(r),s=0|ln(0|t,0|e,3*(15-n|0)|0),I(),_t(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|A}function re(t,e,n){n|=0;var r,A,o=0,s=0,a=0,u=0,c=0,l=0;if(A=M,M=M+16|0,r=A,l=0|ln(0|(t|=0),0|(e|=0),45),I(),(l&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,M=A,0|(l=5);t:do{if(0|z(l)&&(a=0|ln(0|t,0|e,52),I(),0|(a&=15))){o=1;e:for(;;){switch(c=0|ln(0|t,0|e,3*(15-o|0)|0),I(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<a>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;u=0|fn(7,0,0|(e=3*(15-s|0)|0)),c=o&~I(),o=0|ln(0|t,0|o,0|e),I(),t=t&~u|(o=0|fn(0|wt(7&o),0,0|e)),o=0|c|I(),s>>>0<a>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*l|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|ne(t,o,n)))return M=A,0|(l=0);if(u=n+4|0,i[r>>2]=i[u>>2],i[r+4>>2]=i[u+4>>2],i[r+8>>2]=i[u+8>>2],a=0|ln(0|t,0|o,52),I(),c=15&a,1&a?(yt(u),a=c+1|0):a=c,0|z(l)){t:do{if(c)for(e=1;;){if(s=0|ln(0|t,0|o,3*(15-e|0)|0),I(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Bt(n,a,o,0)){if(0|z(l))do{}while(0|Bt(n,a,0,0));(0|a)!=(0|c)&&dt(u)}else(0|a)!=(0|c)&&(i[u>>2]=i[r>>2],i[u+4>>2]=i[r+4>>2],i[u+8>>2]=i[r+8>>2]);return M=A,0|(l=0)}function ie(t,e,n){n|=0;var r,i,A=0;return i=M,M=M+16|0,0|(A=0|re(t|=0,e|=0,r=i))?(M=i,0|A):(A=0|ln(0|t,0|e,52),I(),Pt(r,15&A,n),M=i,0|(A=0))}function Ae(t,e,n){n|=0;var r,i=0,A=0,o=0;if(r=M,M=M+16|0,0|(i=0|re(t|=0,e|=0,o=r)))return M=r,0|(o=i);i=0|ln(0|t,0|e,45),I(),i=!(0|z(127&i)),A=0|ln(0|t,0|e,52),I(),A&=15;t:do{if(!i){if(0|A)for(i=1;;){if(!(!((0|fn(7,0,3*(15-i|0)|0))&t|0)&!((0|I())&e)))break t;if(!(i>>>0<A>>>0))break;i=i+1|0}return Rt(o,A,0,5,n),M=r,0|0}}while(0);return Gt(o,A,0,6,n),M=r,0|0}function oe(t,e){e|=0;var n=0,r=0,A=0,o=0,s=0,a=0,u=0;if((t|=0)>>>0>15)return 0|(a=4);if(fn(0|t,0,52),a=134225919|I(),!t){n=0,r=0;do{0|z(r)&&(fn(0|r,0,45),s=0|a|I(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|z(s)){for(fn(0|s,0,45),r=1,A=-1,o=0|a|I();A&=~(u=0|fn(7,0,3*(15-r|0)|0)),o&=~I(),(0|r)!=(0|t);)r=r+1|0;i[(u=e+(n<<3)|0)>>2]=A,i[u+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function se(t,e,n,r){t|=0,r|=0;var A=0,o=0,s=0;A=0|ln(0|(e|=0),0|(n|=0),52),I(),!(0|e)&!(0|n)|(0|r)>15|(0|(A&=15))>(0|r)?(o=-1,e=-1,n=0,A=0):(e=0|Ht(e,n,A+1|0,r),s=-15728641&I(),n=0|fn(0|r,0,52),o=A,e=(e=!(0|jt(n|=e,s=0|s|I())))?-1:r,A=s),i[(s=t)>>2]=n,i[s+4>>2]=A,i[t+8>>2]=o,i[t+12>>2]=e}function ae(t,e,n,r){n|=0,r|=0;var A=0,o=0;return A=0|ln(0|(t|=0),0|(e|=0),52),I(),A&=15,i[(o=r+8|0)>>2]=A,!(0|t)&!(0|e)|(0|n)>15|(0|A)>(0|n)?(i[(n=r)>>2]=0,i[n+4>>2]=0,i[o>>2]=-1,void(i[r+12>>2]=-1)):(t=0|Ht(t,e,A+1|0,n),o=-15728641&I(),A=0|fn(0|n,0,52),A|=t,o=0|o|I(),i[(t=r)>>2]=A,i[t+4>>2]=o,t=r+12|0,0|jt(A,o)?void(i[t>>2]=n):void(i[t>>2]=-1))}function ue(t){var e,n=0,r=0,A=0,o=0,s=0,a=0,u=0,c=0;if(!(!(0|(n=0|i[(r=t|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(A=0|ln(0|n,0|r,52),I(),n=0|en(0|(u=0|fn(1,0,3*(15^(A&=15))|0)),0|I(),0|n,0|r),r=0|I(),i[(u=t)>>2]=n,i[u+4>>2]=r,(0|A)<(0|(a=0|i[(u=t+8|0)>>2]))))){for(e=t+12|0,s=A;;){if((0|s)==(0|a)){A=5;break}if(c=(0|s)==(0|i[e>>2]),A=0|ln(0|n,0|r,0|(o=3*(15-s|0)|0)),I(),c&1==(0|(A&=7))&!0){A=7;break}if(!(7==(0|A)&!0)){A=10;break}if(n=0|en(0|n,0|r,0|(c=0|fn(1,0,0|o)),0|I()),r=0|I(),i[(c=t)>>2]=n,i[c+4>>2]=r,!((0|s)>(0|a))){A=10;break}s=s+-1|0}if(5==(0|A))return i[(c=t)>>2]=0,i[c+4>>2]=0,i[u>>2]=-1,void(i[e>>2]=-1);if(7==(0|A))return a=0|en(0|n,0|r,0|(a=0|fn(1,0,0|o)),0|I()),u=0|I(),i[(c=t)>>2]=a,i[c+4>>2]=u,void(i[e>>2]=s+-1)}}function ce(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function le(t,e){return e|=0,+u(+(+A[(t|=0)>>3]-+A[e>>3]))<17453292519943298e-27?0|(e=+u(+(+A[t+8>>3]-+A[e+8>>3]))<17453292519943298e-27):0|(e=0)}function fe(t,e){switch(t=+t,0|(e|=0)){case 1:t=t<0?t+6.283185307179586:t;break;case 2:t=t>0?t+-6.283185307179586:t}return+t}function he(t,e){t|=0;var n,r,i,o=0;return r=+A[(e|=0)>>3],n=+A[t>>3],o=(i=+h(.5*(r-n)))*i+(o=+h(.5*(+A[e+8>>3]-+A[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function pe(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[20656+(t<<3)>>3],0|(e=0))}function de(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|sn(0|(n=0|Ie(7,0,t,((0|t)<0)<<31>>31)),0|I(),120,0),t=0|I(),i[e>>2]=2|n,i[e+4>>2]=t,0|(e=0))}function ge(t,e,n){t|=0,n|=0;var r,i,o,s,a=0,u=0,l=0,d=0,g=0,m=0;return m=+A[(e|=0)>>3],o=+A[t>>3],g=+h(.5*(m-o)),l=+A[e+8>>3],i=+A[t+8>>3],d=+h(.5*(l-i)),r=+f(+o),s=+f(+m),d=2*+_(+ +c(+(d=g*g+d*(s*r*d))),+ +c(+(1-d))),g=+A[n>>3],m=+h(.5*(g-m)),a=+A[n+8>>3],l=+h(.5*(a-l)),u=+f(+g),l=2*+_(+ +c(+(l=m*m+l*(s*u*l))),+ +c(+(1-l))),g=+h(.5*(o-g)),a=+h(.5*(i-a)),a=2*+_(+ +c(+(a=g*g+a*(r*u*a))),+ +c(+(1-a))),4*+y(+ +c(+ +p(.5*(u=.5*(d+l+a)))*+p(.5*(u-d))*+p(.5*(u-l))*+p(.5*(u-a))))}function ye(t,e,n){n|=0;var r,o,s,a=0,u=0;if(s=M,M=M+192|0,o=s,0|(u=0|ie(t|=0,e|=0,r=s+168|0)))return M=s,0|(n=u);if(0|Ae(t,e,o)&&x(27795,27190,415,27199),(0|(e=0|i[o>>2]))>0){if(a=+ge(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{a+=+ge(o+8+((u=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r)}while((0|t)<(0|e))}}else a=0;return A[n>>3]=a,M=s,0|(n=0)}function _e(t){t|=0;var e,n,r=0;return(e=0|tn(1,12))||x(27280,27235,49,27293),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&x(27310,27235,61,27333),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function me(t,e){t|=0,e|=0;var n,r;return(r=0|Je(24))||x(27347,27235,78,27361),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&x(27376,27235,82,27361),i[t>>2]=r,i[e>>2]=r,0|r)}function ve(t){var e=0,n=0,r=0,A=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{A=n,n=0|i[n+16>>2],Ze(A)}while(0|n);A=e,e=0|i[e+8>>2],Ze(A)}while(0|e);if(e=t,t=0|i[t+8>>2],r||Ze(e),!t)break;r=0}}function be(t){var e,n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,I=0,S=0,N=0,D=0,L=0,T=0,M=0,O=0,P=0,R=0,k=0;if(0|i[(a=(t|=0)+8|0)>>2])return 0|(k=1);if(!(s=0|i[t>>2]))return 0|(k=0);r=s,o=0;do{o=o+1|0,r=0|i[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(k=0);(n=0|Je(o<<2))||x(27396,27235,317,27415),(e=0|Je(o<<5))||x(27437,27235,321,27415),i[t>>2]=0,i[(N=t+4|0)>>2]=0,i[a>>2]=0,o=0,P=0,S=0,g=0;t:for(;;){if(d=0|i[s>>2]){c=0,l=d;do{if(h=+A[l+8>>3],r=l,l=0|i[l+16>>2],f=+A[(a=(p=!(0|l))?d:l)+8>>3],+u(+(h-f))>3.141592653589793){k=14;break}c+=(f-h)*(+A[r>>3]+ +A[a>>3])}while(!p);if(14==(0|k)){k=0,c=0,r=d;do{I=+A[r+8>>3],M=0|i[(O=r+16|0)>>2],C=+A[(M=0|M?M:d)+8>>3],c+=(+A[r>>3]+ +A[M>>3])*((C<0?C+6.283185307179586:C)-(I<0?I+6.283185307179586:I)),r=0|i[(0|r?O:s)>>2]}while(0|r)}c>0?(i[n+(P<<2)>>2]=s,P=P+1|0,a=S,r=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!o){if(g){a=N,l=g+8|0,r=s,o=t;break}if(0|i[t>>2]){k=27;break t}a=N,l=t,r=s,o=t;break}if(0|i[(r=o+8|0)>>2]){k=21;break t}if(!(o=0|tn(1,12))){k=23;break t}i[r>>2]=o,a=o+4|0,l=o,r=g}while(0);if(i[l>>2]=s,i[a>>2]=s,l=e+(S<<5)|0,p=0|i[s>>2]){for(A[(d=e+(S<<5)+8|0)>>3]=17976931348623157e292,A[(g=e+(S<<5)+24|0)>>3]=17976931348623157e292,A[l>>3]=-17976931348623157e292,A[(y=e+(S<<5)+16|0)>>3]=-17976931348623157e292,w=17976931348623157e292,E=-17976931348623157e292,a=0,_=p,h=17976931348623157e292,v=17976931348623157e292,b=-17976931348623157e292,f=-17976931348623157e292;c=+A[_>>3],I=+A[_+8>>3],_=0|i[_+16>>2],C=+A[((m=!(0|_))?p:_)+8>>3],c<h&&(A[d>>3]=c,h=c),I<v&&(A[g>>3]=I,v=I),c>b?A[l>>3]=c:c=b,I>f&&(A[y>>3]=I,f=I),w=I>0&I<w?I:w,E=I<0&I>E?I:E,a|=+u(+(I-C))>3.141592653589793,!m;)b=c;a&&(A[y>>3]=E,A[g>>3]=w)}else i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,i[l+12>>2]=0,i[l+16>>2]=0,i[l+20>>2]=0,i[l+24>>2]=0,i[l+28>>2]=0;a=S+1|0}if(s=0|i[(O=s+8|0)>>2],i[O>>2]=0,!s){k=45;break}S=a,g=r}if(21==(0|k))x(27213,27235,35,27247);else if(23==(0|k))x(27267,27235,37,27247);else if(27==(0|k))x(27310,27235,61,27333);else if(45==(0|k)){t:do{if((0|P)>0){for(O=!(0|a),T=a<<2,M=!(0|t),L=0,r=0;;){if(D=0|i[n+(L<<2)>>2],O)k=73;else{if(!(S=0|Je(T))){k=50;break}if(!(N=0|Je(T))){k=52;break}e:do{if(M)o=0;else{for(a=0,o=0,l=t;s=e+(a<<5)|0,0|we(0|i[l>>2],s,0|i[D>>2])?(i[S+(o<<2)>>2]=l,i[N+(o<<2)>>2]=s,m=o+1|0):m=o,l=0|i[l+8>>2];)a=a+1|0,o=m;if((0|m)>0)if(s=0|i[S>>2],1==(0|m))o=s;else for(y=0,_=-1,o=s,g=s;;){for(p=0|i[g>>2],s=0,l=0;d=(0|(a=0|i[i[S+(l<<2)>>2]>>2]))==(0|p)?s:s+(1&we(a,0|i[N+(l<<2)>>2],0|i[p>>2]))|0,(0|(l=l+1|0))!=(0|m);)s=d;if(o=(a=(0|d)>(0|_))?g:o,(0|(s=y+1|0))==(0|m))break e;y=s,_=a?d:_,g=0|i[S+(s<<2)>>2]}else o=0}}while(0);if(Ze(S),Ze(N),o){if(s=0|i[(a=o+4|0)>>2])o=s+8|0;else if(0|i[o>>2]){k=70;break}i[o>>2]=D,i[a>>2]=D}else k=73}if(73==(0|k)){if(k=0,0|(r=0|i[D>>2]))do{N=r,r=0|i[r+16>>2],Ze(N)}while(0|r);Ze(D),r=1}if((0|(L=L+1|0))>=(0|P)){R=r;break t}}50==(0|k)?x(27452,27235,249,27471):52==(0|k)?x(27490,27235,252,27471):70==(0|k)&&x(27310,27235,61,27333)}else R=0}while(0);return Ze(n),Ze(e),0|(k=R)}return 0}function we(t,e,n){t|=0;var r=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;if(!(0|J(e|=0,n|=0)))return 0|(t=0);if(e=0|$(e),r=+A[n>>3],o=e&(o=+A[n+8>>3])<0?o+6.283185307179586:o,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,l=o,n=t;t:for(;;){for(;a=+A[n>>3],o=+A[n+8>>3],f=0|i[(n=n+16|0)>>2],s=+A[(f=0|f?f:t)>>3],u=+A[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(((c=(u=a<0?a+6.283185307179586:a)+(r-s)/(c-s)*((a=o<0?o+6.283185307179586:o)-u))<0?c+6.283185307179586:c)>(l=u==l|a==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,l=o,n=t;t:for(;;){for(;a=+A[n>>3],o=+A[n+8>>3],f=0|i[(n=n+16|0)>>2],s=+A[(f=0|f?f:t)>>3],u=+A[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(a+(r-s)/(c-s)*(o-a)>(l=a==l|o==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function Ee(t,e,n,A,o){n|=0,A|=0,o|=0;var s,a,u,c,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(c=M,M=M+32|0,v=c+16|0,u=c,l=0|ln(0|(t|=0),0|(e|=0),52),I(),l&=15,y=0|ln(0|n,0|A,52),I(),(0|l)!=(15&y))return M=c,0|(v=12);if(d=0|ln(0|t,0|e,45),I(),d&=127,g=0|ln(0|n,0|A,45),I(),d>>>0>121|(g&=127)>>>0>121)return M=c,0|(v=5);if(y=(0|d)!=(0|g)){if(7==(0|(h=0|X(d,g))))return M=c,0|(v=1);7==(0|(p=0|X(g,d)))?x(27514,27538,161,27548):(_=h,f=p)}else _=0,f=0;s=0|z(d),a=0|z(g),i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,i[v+12>>2]=0;do{if(_){if(h=(0|(g=0|i[4272+(28*d|0)+(_<<2)>>2]))>0,a)if(h){d=0,p=n,h=A;do{p=0|Jt(p,h),h=0|I(),1==(0|(f=0|wt(f)))&&(f=0|wt(1)),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=A;else if(h){d=0,p=n,h=A;do{p=0|Zt(p,h),h=0|I(),f=0|wt(f),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=A;if(ne(d,p,v),y||x(27563,27538,191,27548),(h=!!(0|s))&(f=!!(0|a))&&x(27590,27538,192,27548),h){if(7==(0|(f=0|Wt(t,e)))){l=5;break}if(0|r[22e3+(7*f|0)+_|0]){l=1;break}d=p=0|i[21168+(28*f|0)+(_<<2)>>2]}else if(f){if(7==(0|(f=0|Wt(d,p)))){l=5;break}if(0|r[22e3+(7*f|0)+g|0]){l=1;break}d=0,p=0|i[21168+(28*g|0)+(f<<2)>>2]}else d=0,p=0;if((d|p|0)<0)l=5;else{if((0|p)>0){h=v+4|0,f=0;do{vt(h),f=f+1|0}while((0|f)!=(0|p))}if(i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,_t(u,_),0|l)for(;0|te(l)?gt(u):yt(u),(0|l)>1;)l=l+-1|0;if((0|d)>0){l=0;do{vt(u),l=l+1|0}while((0|l)!=(0|d))}at(m=v+4|0,u,m),ot(m),m=51}}else if(ne(n,A,v),!!(0|s)&!!(0|a))if((0|g)!=(0|d)&&x(27621,27538,261,27548),7==(0|(f=0|Wt(t,e)))|7==(0|(l=0|Wt(n,A))))l=5;else if(0|r[22e3+(7*f|0)+l|0])l=1;else if((0|(f=0|i[21168+(28*f|0)+(l<<2)>>2]))>0){h=v+4|0,l=0;do{vt(h),l=l+1|0}while((0|l)!=(0|f));m=51}else m=51;else m=51}while(0);return 51==(0|m)&&(l=v+4|0,i[o>>2]=i[l>>2],i[o+4>>2]=i[l+4>>2],i[o+8>>2]=i[l+8>>2],l=0),M=c,0|(v=l)}function Ce(t,e,n,r){n|=0,r|=0;var A,o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(s=M,M=M+48|0,A=s+36|0,c=s+24|0,l=s+12|0,f=s,a=0|ln(0|(t|=0),0|(e|=0),52),I(),a&=15,p=0|ln(0|t,0|e,45),I(),(p&=127)>>>0>121)return M=s,0|(r=5);if(o=0|z(p),fn(0|a,0,52),y=134225919|I(),i[(u=r)>>2]=-1,i[u+4>>2]=y,!a)return 7==(0|(a=0|lt(n)))||127==(0|(a=0|H(p,a)))?(M=s,0|(y=1)):(d=0|fn(0|a,0,45),g=0|I(),g=-1040385&i[(p=r)+4>>2]|g,i[(y=r)>>2]=i[p>>2]|d,i[y+4>>2]=g,M=s,0|(y=0));for(i[A>>2]=i[n>>2],i[A+4>>2]=i[n+4>>2],i[A+8>>2]=i[n+8>>2],n=a;;){if(u=n,n=n+-1|0,i[c>>2]=i[A>>2],i[c+4>>2]=i[A+4>>2],i[c+8>>2]=i[A+8>>2],0|te(u)){if(0|(a=0|ft(A))){n=13;break}i[l>>2]=i[A>>2],i[l+4>>2]=i[A+4>>2],i[l+8>>2]=i[A+8>>2],gt(l)}else{if(0|(a=0|ht(A))){n=13;break}i[l>>2]=i[A>>2],i[l+4>>2]=i[A+4>>2],i[l+8>>2]=i[A+8>>2],yt(l)}if(ut(c,l,f),ot(f),m=0|i[(a=r)>>2],a=0|i[a+4>>2],_=0|fn(7,0,0|(v=3*(15-u|0)|0)),a&=~I(),v=0|fn(0|lt(f),0,0|v),a=0|I()|a,i[(y=r)>>2]=v|m&~_,i[y+4>>2]=a,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|i[A>>2])<=1&&(0|i[A+4>>2])<=1&&(0|i[A+8>>2])<=1){f=127==(0|(a=0|H(p,n=0|lt(A))))?0:0|z(a);e:do{if(n){if(o){if(7==(0|(a=0|Wt(t,e)))){a=5;break t}if((0|(u=0|i[21376+(28*a|0)+(n<<2)>>2]))>0){a=n,n=0;do{a=0|bt(a),n=n+1|0}while((0|n)!=(0|u))}else a=n;if(1==(0|a)){a=9;break t}127==(0|(n=0|H(p,a)))&&x(27648,27538,411,27678),0|z(n)?x(27693,27538,412,27678):(g=n,d=u,h=a)}else g=a,d=0,h=n;if((0|(l=0|i[4272+(28*p|0)+(h<<2)>>2]))<=-1&&x(27724,27538,419,27678),!f){if((0|d)<0){a=5;break t}if(0|d){a=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];do{n=0|Kt(n,u),u=0|I(),i[(v=r)>>2]=n,i[v+4>>2]=u,a=a+1|0}while((0|a)<(0|d))}if((0|l)<=0){a=g,n=58;break}for(a=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];;)if(n=0|Kt(n,u),u=0|I(),i[(v=r)>>2]=n,i[v+4>>2]=u,(0|(a=a+1|0))==(0|l)){a=g,n=58;break e}}if(7==(0|(c=0|X(g,p)))&&x(27514,27538,428,27678),n=0|i[(a=r)>>2],a=0|i[a+4>>2],(0|l)>0){u=0;do{n=0|Kt(n,a),a=0|I(),i[(v=r)>>2]=n,i[v+4>>2]=a,u=u+1|0}while((0|u)!=(0|l))}if(7==(0|(a=0|Wt(n,a)))&&x(27795,27538,440,27678),n=0|q(g),(0|(n=0|i[(n?21792:21584)+(28*c|0)+(a<<2)>>2]))<0&&x(27795,27538,454,27678),n){a=0,u=0|i[(c=r)>>2],c=0|i[c+4>>2];do{u=0|$t(u,c),c=0|I(),i[(v=r)>>2]=u,i[v+4>>2]=c,a=a+1|0}while((0|a)<(0|n));a=g,n=58}else a=g,n=58}else if(!!(0|o)&!!(0|f)){if(7==(0|(n=0|Wt(t,e)))|7==(0|(u=0|Wt(0|i[(u=r)>>2],0|i[u+4>>2])))){a=5;break t}if((0|(u=0|i[21376+(28*n|0)+(u<<2)>>2]))<0){a=5;break t}if(u){n=0,c=0|i[(l=r)>>2],l=0|i[l+4>>2];do{c=0|Kt(c,l),l=0|I(),i[(v=r)>>2]=c,i[v+4>>2]=l,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&f&&(n=59),59==(0|n)&&1==(0|Wt(0|i[(v=r)>>2],0|i[v+4>>2]))){a=9;break}_=0|i[(v=r)>>2],v=-1040385&i[v+4>>2],m=0|fn(0|a,0,45),v=0|v|I(),i[(a=r)>>2]=_|m,i[a+4>>2]=v,a=0}else a=1}while(0);return M=s,0|(v=a)}function Ie(t,e,n,r){t|=0,e|=0;var i=0,A=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return A=1,C(0|(i=0)),0|A;A=t,i=e,t=1,e=0;do{t=0|sn(0|((o=!0&!(1&n))?1:A),0|(o?0:i),0|t,0|e),e=0|I(),n=0|cn(0|n,0|r,1),r=0|I(),A=0|sn(0|A,0|i,0|A,0|i),i=0|I()}while(!(!(0|n)&!(0|r)));return C(0|e),0|t}function xe(t,e,n,r){n|=0,r|=0;var o,s=0,a=0,u=0,c=0,l=0,h=0;o=M,M=M+16|0,a=o,u=0|ln(0|(t|=0),0|(e|=0),52),I(),u&=15;do{if(u){if(!(s=0|ie(t,e,a))){l=+A[a>>3],c=1/+f(+l),h=+A[25968+(u<<3)>>3],A[n>>3]=l+h,A[n+8>>3]=l-h,l=+A[a+8>>3],c*=h,A[n+16>>3]=c+l,A[n+24>>3]=l-c;break}return M=o,0|(u=s)}if(s=0|ln(0|t,0|e,45),I(),(s&=127)>>>0>121)return M=o,0|(u=5);a=22064+(s<<5)|0,i[n>>2]=i[a>>2],i[n+4>>2]=i[a+4>>2],i[n+8>>2]=i[a+8>>2],i[n+12>>2]=i[a+12>>2],i[n+16>>2]=i[a+16>>2],i[n+20>>2]=i[a+20>>2],i[n+24>>2]=i[a+24>>2],i[n+28>>2]=i[a+28>>2];break}while(0);return function(t,e){e=+e;var n,r,i,o,s,a,u,c=0,l=0;c=(o=+A[(i=16+(t|=0)|0)>>3])-(r=+A[(n=t+24|0)>>3]),c=o<r?c+6.283185307179586:c,l=+A[t>>3],c=.5*(c*e-c),l+=e=.5*((u=l-(a=+A[(s=t+8|0)>>3]))*e-u),A[t>>3]=l>1.5707963267948966?1.5707963267948966:l,e=a-e,A[s>>3]=e<-1.5707963267948966?-1.5707963267948966:e,e=(e=o+c)>3.141592653589793?e+-6.283185307179586:e,A[i>>3]=e<-3.141592653589793?e+6.283185307179586:e,e=(e=r-c)>3.141592653589793?e+-6.283185307179586:e,A[n>>3]=e<-3.141592653589793?e+6.283185307179586:e}(n,r?1.4:1.1),(0|i[(r=26096+(u<<3)|0)>>2])==(0|t)&&(0|i[r+4>>2])==(0|e)&&(A[n>>3]=1.5707963267948966),(0|i[(u=26224+(u<<3)|0)>>2])==(0|t)&&(0|i[u+4>>2])==(0|e)&&(A[n+8>>3]=-1.5707963267948966),1.5707963267948966!=+A[n>>3]&&-1.5707963267948966!=+A[n+8>>3]?(M=o,0|(u=0)):(A[n+16>>3]=3.141592653589793,A[n+24>>3]=-3.141592653589793,M=o,0|(u=0))}function Se(t,e,n,A){t|=0,e|=0,n|=0,A|=0;var o,s,a,u=0,c=0,l=0,f=0;a=M,M=M+48|0,o=a+40|0,s=a,qt(c=a+32|0,0,0,0),l=0|i[c>>2],c=0|i[c+4>>2];do{if(n>>>0<=15){if(0|(u=0|Me(A))){i[(A=s)>>2]=0,i[A+4>>2]=0,i[s+8>>2]=u,i[s+12>>2]=-1,l=s+29|0,i[(A=s+16|0)>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,r[A+12|0]=0,r[l|0]=0|r[o|0],r[l+1|0]=0|r[o+1|0],r[l+2|0]=0|r[o+2|0];break}if(u=0|tn(1+(0|i[e+8>>2])|0,32)){Oe(e,u),i[(f=s)>>2]=l,i[f+4>>2]=c,i[s+8>>2]=0,i[s+12>>2]=n,i[s+16>>2]=A,i[s+20>>2]=e,i[s+24>>2]=u,r[s+28|0]=0,r[(l=s+29|0)|0]=0|r[o|0],r[l+1|0]=0|r[o+1|0],r[l+2|0]=0|r[o+2|0];break}i[(A=s)>>2]=0,i[A+4>>2]=0,i[s+8>>2]=13,i[s+12>>2]=-1,l=s+29|0,i[(A=s+16|0)>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,r[A+12|0]=0,r[l|0]=0|r[o|0],r[l+1|0]=0|r[o+1|0],r[l+2|0]=0|r[o+2|0];break}i[(l=s)>>2]=0,i[l+4>>2]=0,i[s+8>>2]=4,i[s+12>>2]=-1,f=s+29|0,i[(l=s+16|0)>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,r[l+12|0]=0,r[f|0]=0|r[o|0],r[f+1|0]=0|r[o+1|0],r[f+2|0]=0|r[o+2|0]}while(0);Ne(s),i[t>>2]=i[s>>2],i[t+4>>2]=i[s+4>>2],i[t+8>>2]=i[s+8>>2],i[t+12>>2]=i[s+12>>2],i[t+16>>2]=i[s+16>>2],i[t+20>>2]=i[s+20>>2],i[t+24>>2]=i[s+24>>2],i[t+28>>2]=i[s+28>>2],M=a}function Ne(t){var e,n,A,o,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0;if(o=M,M=M+336|0,e=o+168|0,n=o,!(0|(a=0|i[(u=t|=0)>>2]))&!(0|(u=0|i[u+4>>2])))M=o;else{if(0|r[(s=t+28|0)|0]?(a=0|De(a,u),u=0|I()):r[s|0]=1,!(0|i[i[(A=t+20|0)>>2]>>2]))return 0|(a=0|i[(s=t+24|0)>>2])&&Ze(a),i[(w=t)>>2]=0,i[w+4>>2]=0,i[t+8>>2]=0,i[A>>2]=0,i[t+12>>2]=-1,i[t+16>>2]=0,i[s>>2]=0,void(M=o);c=15&(s=0|i[(w=t+16|0)>>2]);t:do{if(!(0|a)&!(0|u))b=t+24|0;else{m=t+12|0,y=3==(0|c),g=255&s,p=3==(1|c),_=t+24|0,d=(c+-1|0)>>>0<3,f=3==(2|c),h=n+8|0;e:for(;;){if(l=0|ln(0|a,0|u,52),I(),(0|(l&=15))==(0|i[m>>2])){switch(15&g){case 0:case 2:case 3:if(0|(c=0|ie(a,u,e))){v=15;break e}if(0|Pe(0|i[A>>2],0|i[_>>2],e)){v=19;break e}}if(p&&(c=0|i[4+(0|i[A>>2])>>2],i[e>>2]=i[c>>2],i[e+4>>2]=i[c+4>>2],i[e+8>>2]=i[c+8>>2],i[e+12>>2]=i[c+12>>2],0|J(26832,e))){if(0|ee(0|i[4+(0|i[A>>2])>>2],l,n)){v=25;break}if((0|i[(c=n)>>2])==(0|a)&&(0|i[c+4>>2])==(0|u)){v=29;break}}if(d){if(0|(c=0|Ae(a,u,e))){v=32;break}if(0|xe(a,u,n,0)){v=36;break}if(f&&0|Re(0|i[A>>2],0|i[_>>2],e,n)){v=42;break}if(p&&0|Be(0|i[A>>2],0|i[_>>2],e,n)){v=42;break}}if(y){if(s=0|xe(a,u,e,1),c=0|i[_>>2],0|s){v=45;break}if(0|Z(c,e)){if(et(n,e),0|tt(e,0|i[_>>2])){v=53;break}if(0|Pe(0|i[A>>2],0|i[_>>2],h)){v=53;break}if(0|Be(0|i[A>>2],0|i[_>>2],n,e)){v=53;break}}}}do{if((0|l)<(0|i[m>>2])){if(s=0|xe(a,u,e,1),c=0|i[_>>2],0|s){v=58;break e}if(!(0|Z(c,e))){v=73;break}if(0|tt(0|i[_>>2],e)&&(et(n,e),0|Re(0|i[A>>2],0|i[_>>2],n,e))){v=65;break e}if(0|(a=0|Xt(a,u,l+1|0,n))){v=67;break e}a=0|i[(u=n)>>2],u=0|i[u+4>>2]}else v=73}while(0);if(73==(0|v)&&(v=0,a=0|De(a,u),u=0|I()),!(0|a)&!(0|u)){b=_;break t}}switch(0|v){case 15:0|(s=0|i[_>>2])&&Ze(s),i[(v=t)>>2]=0,i[v+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=c,v=20;break;case 19:i[t>>2]=a,i[t+4>>2]=u,v=20;break;case 25:x(27795,27761,470,27772);break;case 29:case 42:return i[t>>2]=a,i[t+4>>2]=u,void(M=o);case 32:return 0|(s=0|i[_>>2])&&Ze(s),i[(b=t)>>2]=0,i[b+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=c,void(M=o);case 36:x(27795,27761,493,27772);break;case 45:0|c&&Ze(c),i[(v=t)>>2]=0,i[v+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=s,v=55;break;case 53:i[t>>2]=a,i[t+4>>2]=u,v=55;break;case 58:0|c&&Ze(c),i[(v=t)>>2]=0,i[v+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=s,v=71;break;case 65:i[t>>2]=a,i[t+4>>2]=u,v=71;break;case 67:return 0|(s=0|i[_>>2])&&Ze(s),i[(b=t)>>2]=0,i[b+4>>2]=0,i[A>>2]=0,i[m>>2]=-1,i[w>>2]=0,i[_>>2]=0,i[t+8>>2]=a,void(M=o)}if(20==(0|v))return void(M=o);if(55==(0|v))return void(M=o);if(71==(0|v))return void(M=o)}}while(0);0|(s=0|i[b>>2])&&Ze(s),i[(v=t)>>2]=0,i[v+4>>2]=0,i[t+8>>2]=0,i[A>>2]=0,i[t+12>>2]=-1,i[w>>2]=0,i[b>>2]=0,M=o}}function De(t,e){var n,r=0,A=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;n=M,M=M+16|0,f=n,A=0|ln(0|(t|=0),0|(e|=0),52),I(),A&=15,r=0|ln(0|t,0|e,45),I();do{if(A){for(;r=0|fn(A+4095|0,0,52),o=I()|-15728641&e,r=r|t|(a=0|fn(7,0,0|(s=3*(15-A|0)|0))),o|=u=0|I(),c=0|ln(0|t,0|e,0|s),I(),A=A+-1|0,!((c&=7)>>>0<6);){if(!A){l=4;break}e=o,t=r}if(4==(0|l)){r=0|ln(0|r,0|o,45),I();break}return f=0|fn(((f=!(0|c)&!!(0|jt(r,o)))?2:1)+c|0,0,0|s),l=0|I()|e&~u,f|=t&~a,C(0|l),M=n,0|f}}while(0);return(r&=127)>>>0>120?(f=0,C(0|(l=0)),M=n,0|f):(qt(f,0,r+1|0,0),l=0|i[f+4>>2],f=0|i[f>>2],C(0|l),M=n,0|f)}function Le(t,e,n){t|=0;var r,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if(!(0|J(e|=0,n|=0)))return 0|(p=0);if(e=0|$(e),o=+A[n>>3],s=e&(s=+A[n+8>>3])<0?s+6.283185307179586:s,(0|(p=0|i[t>>2]))<=0)return 0|(p=0);if(r=0|i[t+4>>2],e){e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+A[r+(f<<4)>>3],s=+A[r+(f<<4)+8>>3],a=+A[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+A[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(((l=(c=u<0?u+6.283185307179586:u)+(o-a)/(l-a)*((u=s<0?s+6.283185307179586:s)-c))<0?l+6.283185307179586:l)>(h=c==h|u==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}else{e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+A[r+(f<<4)>>3],s=+A[r+(f<<4)+8>>3],a=+A[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+A[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(u+(o-a)/(l-a)*(s-u)>(h=u==h|s==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}return 0}function Te(t,e){e|=0;var n,r,o,s,a,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(A[(o=e+8|0)>>3]=17976931348623157e292,A[(s=e+24|0)>>3]=17976931348623157e292,A[e>>3]=-17976931348623157e292,A[(a=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],y=17976931348623157e292,_=-17976931348623157e292,m=0,t=-1,h=17976931348623157e292,p=17976931348623157e292,g=-17976931348623157e292,l=-17976931348623157e292,v=0;c=+A[n+(v<<4)>>3],d=+A[n+(v<<4)+8>>3],f=+A[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<h&&(A[o>>3]=c,h=c),d<p&&(A[s>>3]=d,p=d),c>g?A[e>>3]=c:c=g,d>l&&(A[a>>3]=d,l=d),y=d>0&d<y?d:y,_=d<0&d>_?d:_,m|=+u(+(d-f))>3.141592653589793,(0|(t=v+1|0))!=(0|r);)b=v,g=c,v=t,t=b;m&&(A[a>>3]=_,A[s>>3]=y)}}function Me(t){return 0|((t|=0)>>>0<4?0:15)}function Oe(t,e){e|=0;var n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,I=0,x=0;if(_=0|i[(t|=0)>>2]){if(A[(m=e+8|0)>>3]=17976931348623157e292,A[(v=e+24|0)>>3]=17976931348623157e292,A[e>>3]=-17976931348623157e292,A[(b=e+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(s=0|i[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,o=0,r=-1,f=17976931348623157e292,h=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292,w=0;a=+A[s+(w<<4)>>3],p=+A[s+(w<<4)+8>>3],l=+A[s+(((0|(I=r+2|0))==(0|_)?0:I)<<4)+8>>3],a<f&&(A[m>>3]=a,f=a),p<h&&(A[v>>3]=p,h=p),a>d?A[e>>3]=a:a=d,p>c&&(A[b>>3]=p,c=p),g=p>0&p<g?p:g,y=p<0&p>y?p:y,o|=+u(+(p-l))>3.141592653589793,(0|(r=w+1|0))!=(0|_);)I=w,d=a,w=r,r=I;o&&(A[b>>3]=y,A[v>>3]=g)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(I=t+8|0)>>2]))<=0)){n=t+12|0,C=0;do{if(s=0|i[n>>2],o=C,v=e+((C=C+1|0)<<5)|0,b=0|i[s+(o<<3)>>2]){if(A[(w=e+(C<<5)+8|0)>>3]=17976931348623157e292,A[(t=e+(C<<5)+24|0)>>3]=17976931348623157e292,A[v>>3]=-17976931348623157e292,A[(E=e+(C<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(_=0|i[s+(o<<3)+4>>2],g=17976931348623157e292,y=-17976931348623157e292,s=0,o=-1,m=0,f=17976931348623157e292,h=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;a=+A[_+(m<<4)>>3],d=+A[_+(m<<4)+8>>3],l=+A[_+(((0|(o=o+2|0))==(0|b)?0:o)<<4)+8>>3],a<f&&(A[w>>3]=a,f=a),d<h&&(A[t>>3]=d,h=d),a>p?A[v>>3]=a:a=p,d>c&&(A[E>>3]=d,c=d),g=d>0&d<g?d:g,y=d<0&d>y?d:y,s|=+u(+(d-l))>3.141592653589793,(0|(o=m+1|0))!=(0|b);)x=m,m=o,p=a,o=x;s&&(A[E>>3]=y,A[t>>3]=g)}}else i[v>>2]=0,i[v+4>>2]=0,i[v+8>>2]=0,i[v+12>>2]=0,i[v+16>>2]=0,i[v+20>>2]=0,i[v+24>>2]=0,i[v+28>>2]=0,r=0|i[I>>2]}while((0|C)<(0|r))}}function Pe(t,e,n){var r=0,A=0,o=0;if(!(0|Le(t|=0,e|=0,n|=0)))return 0|(A=0);if((0|i[(A=t+8|0)>>2])<=0)return 0|(A=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|Le((0|i[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[A>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function Re(t,e,n,r){r|=0;var A,o,s=0,a=0,u=0,c=0,l=0;if(o=M,M=M+16|0,A=o,!(0|Le(t|=0,e|=0,u=(n|=0)+8|0)))return M=o,0|(c=0);c=t+8|0;t:do{if((0|i[c>>2])>0){for(a=t+12|0,s=0;;){if(l=s,s=s+1|0,0|Le((0|i[a>>2])+(l<<3)|0,e+(s<<5)|0,u)){s=0;break}if((0|s)>=(0|i[c>>2]))break t}return M=o,0|s}}while(0);if(0|ke(t,e,n,r))return M=o,0|(l=0);i[A>>2]=i[n>>2],i[A+4>>2]=u,s=0|i[c>>2];t:do{if((0|s)>0)for(t=t+12|0,u=0,a=s;;){if(s=0|i[t>>2],(0|i[s+(u<<3)>>2])>0){if(0|Le(A,r,0|i[s+(u<<3)+4>>2])){s=0;break t}if(s=u+1|0,0|ke((0|i[t>>2])+(u<<3)|0,e+(s<<5)|0,n,r)){s=0;break t}a=0|i[c>>2]}else s=u+1|0;if(!((0|s)<(0|a))){s=1;break}u=s}else s=1}while(0);return M=o,0|(l=s)}function ke(t,e,n,r){t|=0,n|=0;var o,s,a,u,c,l,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,I=0,x=0;if(l=M,M=M+176|0,u=l+172|0,f=l+168|0,c=l,!(0|Z(e|=0,r|=0)))return M=l,0|(t=0);if(function(t,e,n,r){var o,s,a,u,c;e|=0,n|=0,r|=0,t=(s=+A[16+(t|=0)>>3])<(c=+A[t+24>>3]),o=(u=+A[e+16>>3])<(a=+A[e+24>>3]),e=c-u<a-s,i[n>>2]=t?o|e?1:2:0,i[r>>2]=o?t?1:e?2:1:0}(e,r,u,f),yn(0|c,0|n,168),(0|i[n>>2])>0){e=0;do{w=+fe(+A[(I=c+8+(e<<4)+8|0)>>3],0|i[f>>2]),A[I>>3]=w,e=e+1|0}while((0|e)<(0|i[n>>2]))}s=+A[r>>3],a=+A[r+8>>3],w=+fe(+A[r+16>>3],0|i[f>>2]),o=+fe(+A[r+24>>3],0|i[f>>2]);t:do{if((0|i[t>>2])>0){if(r=t+4|0,(0|(f=0|i[c>>2]))<=0)for(e=0;;)if((0|(e=e+1|0))>=(0|i[t>>2])){e=0;break t}for(n=0;;){if(e=0|i[r>>2],v=+A[e+(n<<4)>>3],b=+fe(+A[e+(n<<4)+8>>3],0|i[u>>2]),e=0|i[r>>2],I=(0|(n=n+1|0))%(0|i[t>>2])|0,h=+A[e+(I<<4)>>3],p=+fe(+A[e+(I<<4)+8>>3],0|i[u>>2]),!(v>=s)|!(h>=s)&&!(v<=a)|!(h<=a)&&!(b<=o)|!(p<=o)&&!(b>=w)|!(p>=w)){m=h-v,y=p-b,e=0;do{if(x=e,I=(0|(e=e+1|0))==(0|f)?0:e,h=+A[c+8+(x<<4)+8>>3],p=+A[c+8+(I<<4)+8>>3]-h,d=+A[c+8+(x<<4)>>3],!(0==(_=m*p-y*(g=+A[c+8+(I<<4)>>3]-d))||(E=b-h,C=v-d,g=(E*g-p*C)/_,g<0|g>1))&&(_=(m*E-y*C)/_)>=0&_<=1){e=1;break t}}while((0|e)<(0|f))}if((0|n)>=(0|i[t>>2])){e=0;break}}}else e=0}while(0);return M=l,0|(x=e)}function Be(t,e,n,r){var A=0,o=0,s=0;if(0|ke(t|=0,e|=0,n|=0,r|=0))return 0|(o=1);if((0|i[(o=t+8|0)>>2])<=0)return 0|(o=0);for(A=t+12|0,t=0;;){if(s=t,t=t+1|0,0|ke((0|i[A>>2])+(s<<3)|0,e+(t<<5)|0,n,r)){t=1,A=6;break}if((0|t)>=(0|i[o>>2])){t=0,A=6;break}}return 6==(0|A)?0|t:0}function Fe(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,s,a,u,c,l,f,h=0;u=+A[(t|=0)>>3],a=+A[e>>3]-u,s=+A[t+8>>3],o=+A[e+8>>3]-s,l=+A[n>>3],h=((h=+A[r>>3]-l)*(s-(f=+A[n+8>>3]))-(u-l)*(c=+A[r+8>>3]-f))/(a*c-o*h),A[i>>3]=u+a*h,A[i+8>>3]=s+o*h}function Ge(t,e){return e|=0,+u(+(+A[(t|=0)>>3]-+A[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+A[t+8>>3]-+A[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function Ue(t,e){e|=0;var n,r,i;return+((i=+A[(t|=0)>>3]-+A[e>>3])*i+(r=+A[t+8>>3]-+A[e+8>>3])*r+(n=+A[t+16>>3]-+A[e+16>>3])*n)}function Qe(t,e,n){n|=0;var r,A,o,s,a=0,u=0,c=0,l=0;if(s=M,M=M+32|0,l=s,0|(a=0|re(t|=0,e|=0,A=s+16|0)))return M=s,0|(n=a);r=0|Qt(t,e),o=0|Wt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2]}(r,l),a=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|i[11120+(216*e|0)>>2])!=(0|t))if((0|i[11120+(216*e|0)+8>>2])!=(0|t))if((0|i[11120+(216*e|0)+16>>2])!=(0|t))if((0|i[11120+(216*e|0)+24>>2])!=(0|t))if((0|i[11120+(216*e|0)+32>>2])!=(0|t))if((0|i[11120+(216*e|0)+40>>2])!=(0|t))if((0|i[11120+(216*e|0)+48>>2])!=(0|t))if((0|i[11120+(216*e|0)+56>>2])!=(0|t))if((0|i[11120+(216*e|0)+64>>2])!=(0|t))if((0|i[11120+(216*e|0)+72>>2])!=(0|t))if((0|i[11120+(216*e|0)+80>>2])!=(0|t))if((0|i[11120+(216*e|0)+88>>2])!=(0|t))if((0|i[11120+(216*e|0)+96>>2])!=(0|t))if((0|i[11120+(216*e|0)+104>>2])!=(0|t))if((0|i[11120+(216*e|0)+112>>2])!=(0|t))if((0|i[11120+(216*e|0)+120>>2])!=(0|t))if((0|i[11120+(216*e|0)+128>>2])!=(0|t)){if((0|i[11120+(216*e|0)+136>>2])!=(0|t)){if((0|i[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|i[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|i[A>>2]);do{if(0|z(r)){switch(0|r){case 4:u=0;break;case 14:u=1;break;case 24:u=2;break;case 38:u=3;break;case 49:u=4;break;case 58:u=5;break;case 63:u=6;break;case 72:u=7;break;case 83:u=8;break;case 97:u=9;break;case 107:u=10;break;case 117:u=11;break;default:x(27795,27797,75,27806)}if(c=0|i[26416+(24*u|0)+8>>2],e=0|i[26416+(24*u|0)+16>>2],(0|(t=0|i[A>>2]))!=(0|i[l>>2])&&(l=0|q(r))|(0|(t=0|i[A>>2]))==(0|e)&&(a=(a+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){a=(a+5|0)%6|0;break}5==(0|o)&(0|t)==(0|c)&&(a=(a+1|0)%6|0)}}while(0);return i[n>>2]=a,M=s,0|(n=0)}function ze(t,e,n,r){n|=0,r|=0;var A,o,s,a,u,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(u=M,M=M+32|0,v=u+24|0,a=u+20|0,s=u+8|0,o=u+16|0,A=u,p=(p=!(0|jt(t|=0,e|=0)))?6:5,g=0|ln(0|t,0|e,52),I(),p>>>0<=n>>>0)return M=u,0|(r=2);!(y=!(0|(g&=15)))&&!((_=0|fn(7,0,3*(15^g)|0))&t|0)&!((0|I())&e)?c=n:l=4;t:do{if(4==(0|l)){if((0|((c=!!(0|jt(t,e)))?4:5))<(0|n))return M=u,0|(r=1);if(0|Qe(t,e,v))return M=u,0|(r=1);if(l=(0|i[v>>2])+n|0,7==(0|(_=0|i[(c=c?26704+((0|l)%5<<2)|0:26736+((0|l)%6<<2)|0)>>2])))return M=u,0|(r=1);i[a>>2]=0,c=0|B(t,e,_,a,s);do{if(!c){if(d=0|i[(h=s)>>2],l=(f=(h=0|i[h+4>>2])>>>0<e>>>0|(0|h)==(0|e)&d>>>0<t>>>0)?d:t,f=f?h:e,!y&&!(d&(y=0|fn(7,0,3*(15^g)|0))|0)&!(h&(0|I())))c=n;else{if(h=(n+-1+p|0)%(0|p)|0,c=0|jt(t,e),(0|h)<0&&x(27795,27797,248,27822),(0|((p=!!(0|c))?4:5))<(0|h)&&x(27795,27797,248,27822),0|Qe(t,e,v)&&x(27795,27797,248,27822),c=(0|i[v>>2])+h|0,7==(0|(h=0|i[(c=p?26704+((0|c)%5<<2)|0:26736+((0|c)%6<<2)|0)>>2]))&&x(27795,27797,248,27822),i[o>>2]=0,0|(c=0|B(t,e,h,o,A)))break;p=0|i[(d=A)>>2],d=0|i[d+4>>2];do{if(d>>>0<f>>>0|(0|d)==(0|f)&p>>>0<l>>>0){if(l=0|jt(p,d)?0|U(p,d,t,e):0|i[26800+(((0|i[o>>2])+(0|i[26768+(h<<2)>>2])|0)%6<<2)>>2],c=0|jt(p,d),(l+-1|0)>>>0>5){c=-1,l=p,f=d;break}if(1==(0|l)&(c=!!(0|c))){c=-1,l=p,f=d;break}do{if(!(0|Qe(p,d,v))){if(c){c=(5+(0|i[26352+(l<<2)>>2])-(0|i[v>>2])|0)%5|0;break}c=(6+(0|i[26384+(l<<2)>>2])-(0|i[v>>2])|0)%6|0;break}c=-1}while(0);l=p,f=d}else c=n}while(0);d=0|i[(h=s)>>2],h=0|i[h+4>>2]}if((0|l)==(0|d)&(0|f)==(0|h)){if(t=(p=!!(0|jt(d,h)))?0|U(d,h,t,e):0|i[26800+(((0|i[a>>2])+(0|i[26768+(_<<2)>>2])|0)%6<<2)>>2],c=0|jt(d,h),(t+-1|0)>>>0<=5&&!(1==(0|t)&(m=!!(0|c))))do{if(!(0|Qe(d,h,v))){if(m){c=(5+(0|i[26352+(t<<2)>>2])-(0|i[v>>2])|0)%5|0;break}c=(6+(0|i[26384+(t<<2)>>2])-(0|i[v>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|p&5==(0|c)?0:c}e=f,t=l;break t}}while(0);return M=u,0|(r=c)}}while(0);return m=0|fn(0|c,0,56),v=I()|-2130706433&e|536870912,i[r>>2]=m|t,i[r+4>>2]=v,M=u,0|(r=0)}function qe(t,e){t|=0;var n,r,A=0,o=0;return r=M,M=M+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|zt(t,A=-2130706433&e|134217728)?(o=0|ln(0|t,0|e,56),I(),A=(o=!(0|ze(t,A,7&o,n)))&((0|i[(A=n)>>2])==(0|t)?(0|i[A+4>>2])==(0|e):0)&1,M=r,0|A):(M=r,0|(A=0))}function Ve(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|tn(e,4),i[t>>2]=r,r||x(27835,27858,40,27872)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function Ye(t){var e,n,r,o=0,s=0,a=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(a=0|i[t>>2],c=0|i[a+(o<<2)>>2])break;o=o+1|0}o=a+(~~(+u(+ +l(10,+ +(15-(0|i[n>>2])|0))*(+A[c>>3]+ +A[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[o>>2];e:do{if(0|s){if(a=c+32|0,(0|s)==(0|c))i[o>>2]=i[a>>2];else{if(!(o=0|i[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|i[(s=o+32|0)>>2]))break e;i[s>>2]=i[a>>2]}Ze(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Ze(0|i[t>>2])}function je(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function He(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|i[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){i[r+32>>2]=i[s>>2];break}if(10==(0|o))return 0|n}else i[n>>2]=i[s>>2]}while(0);return Ze(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function Xe(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,a=0;(r=0|Je(40))||x(27888,27858,98,27901),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|i[t+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,o=0|i[s>>2];do{if(o){for(;!(0|le(o,e)&&0|le(o+16|0,n));)if(s=0|i[o+32>>2],!(0|i[(o=0|s?s:o)+32>>2])){a=10;break}if(10==(0|a)){i[o+32>>2]=r;break}return Ze(r),0|(a=o)}i[s>>2]=r}while(0);return i[(a=t+8|0)>>2]=1+(0|i[a>>2]),0|(a=r)}function We(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(o=0|i[(0|i[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|le(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|le(t,e)&&0|le(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function $e(t,e){e|=0;var n=0;if(n=~~(+u(+ +l(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+A[e>>3]+ +A[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|le(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ke(t){return 0|+mn(+(t=+t))}function Je(t){t|=0;var e,n=0,r=0,A=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0;e=M,M=M+16|0,p=e;do{if(t>>>0<245){if(t=(l=t>>>0<11?16:t+11&-8)>>>3,3&(r=(h=0|i[6981])>>>t))return A=0|i[(r=(t=27964+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(o=A+8|0)>>2]))==(0|t)?i[6981]=h&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),w=n<<3,i[A+4>>2]=3|w,i[(w=A+w+4|0)>>2]=1|i[w>>2],M=e,0|(w=o);if(l>>>0>(f=0|i[6983])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=27964+((A=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(A=(n>>>=t)>>>1&1))+(n>>>A)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(u=s+8|0)>>2]))==(0|n)?(t=h&~(1<<A),i[6981]=t):(i[r+12>>2]=n,i[t>>2]=r,t=h),a=(w=A<<3)-l|0,i[s+4>>2]=3|l,i[(o=s+l|0)+4>>2]=1|a,i[s+w>>2]=a,0|f&&(A=0|i[6986],r=27964+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=A,i[n+12>>2]=A,i[A+8>>2]=n,i[A+12>>2]=r),i[6983]=a,i[6986]=o,M=e,0|(w=u);if(s=0|i[6982]){for(r=(s&0-s)-1|0,r=c=0|i[28228+(((A=(r>>>=o=r>>>12&16)>>>5&8)|o|(a=(r>>>=A)>>>2&4)|(u=(r>>>=a)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&i[c+4>>2])-l|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,u=(o=(a=(-8&i[t+4>>2])-l|0)>>>0<c>>>0)?t:u,c=o?a:c;if((a=u+l|0)>>>0>u>>>0){o=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(t=u+20|0)>>2])&&!(n=0|i[(t=u+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(A=n+20|0)>>2])n=r,t=A;else{if(!(r=0|i[(A=n+16|0)>>2]))break;n=r,t=A}i[t>>2]=0,r=n}else r=0|i[u+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|i[u+28>>2],(0|u)==(0|i[(t=28228+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[6982]=s&~(1<<n);break}}else if(i[((0|i[(w=o+16|0)>>2])==(0|u)?w:o+20)>>2]=r,!r)break;i[r+24>>2]=o,0|(n=0|i[u+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[u+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(w=c+l|0,i[u+4>>2]=3|w,i[(w=u+w+4|0)>>2]=1|i[w>>2]):(i[u+4>>2]=3|l,i[a+4>>2]=1|c,i[a+c>>2]=c,0|f&&(A=0|i[6986],r=27964+((n=f>>>3)<<1<<2)|0,(n=1<<n)&h?n=0|i[(t=r+8|0)>>2]:(i[6981]=n|h,n=r,t=r+8|0),i[t>>2]=A,i[n+12>>2]=A,i[A+8>>2]=n,i[A+12>>2]=r),i[6983]=c,i[6986]=a),M=e,0|(w=u+8|0)}h=l}else h=l}else h=l}else if(t>>>0<=4294967231)if(l=-8&(t=t+11|0),A=0|i[6982]){o=0-l|0,c=(t>>>=8)?l>>>0>16777215?31:l>>>((c=14-((u=((y=t<<(h=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|h|(c=((y<<=u)+245760|0)>>>16&2))+(y<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[28228+(c<<2)>>2];t:do{if(r)for(t=0,u=l<<(31==(0|c)?0:25-(c>>>1)|0),s=0;;){if((a=(-8&i[r+4>>2])-l|0)>>>0<o>>>0){if(!a){t=r,o=0,y=65;break t}t=r,o=a}if(s=!(0|(y=0|i[r+20>>2]))|(0|y)==(0|(r=0|i[r+16+(u>>>31<<2)>>2]))?s:y,!r){r=s,y=61;break}u<<=1}else r=0,t=0,y=61}while(0);if(61==(0|y)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&A)){h=l;break}h=(t&0-t)-1|0,t=0,r=0|i[28228+(((s=(h>>>=a=h>>>12&16)>>>5&8)|a|(u=(h>>>=s)>>>2&4)|(c=(h>>>=u)>>>1&2)|(r=(h>>>=c)>>>1&1))+(h>>>r)<<2)>>2]}r?y=65:(u=t,a=o)}if(65==(0|y))for(s=r;;){if(o=(r=(h=(-8&i[s+4>>2])-l|0)>>>0<o>>>0)?h:o,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){u=t,a=o;break}s=r}if(0|u&&a>>>0<((0|i[6983])-l|0)>>>0&&(f=u+l|0)>>>0>u>>>0){s=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(t=u+20|0)>>2])&&!(n=0|i[(t=u+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0}else w=0|i[u+8>>2],i[w+12>>2]=n,i[n+8>>2]=w}while(0);do{if(s){if(t=0|i[u+28>>2],(0|u)==(0|i[(r=28228+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){A&=~(1<<t),i[6982]=A;break}}else if(i[((0|i[(w=s+16|0)>>2])==(0|u)?w:s+20)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[u+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[u+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(a>>>0<16)w=a+l|0,i[u+4>>2]=3|w,i[(w=u+w+4|0)>>2]=1|i[w>>2];else{if(i[u+4>>2]=3|l,i[f+4>>2]=1|a,i[f+a>>2]=a,n=a>>>3,a>>>0<256){r=27964+(n<<1<<2)|0,(t=0|i[6981])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=f,i[n+12>>2]=f,i[f+8>>2]=n,i[f+12>>2]=r;break}if(n=28228+((r=(n=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((v=((w=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(r=((w<<=v)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[f+28>>2]=r,i[(t=f+16|0)+4>>2]=0,i[t>>2]=0,!(A&(t=1<<r))){i[6982]=A|t,i[n>>2]=f,i[f+24>>2]=n,i[f+12>>2]=f,i[f+8>>2]=f;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2])!=(0|a)){for(A=a<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(r=n+16+(A>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|a)){n=t;break e}A<<=1,n=t}i[r>>2]=f,i[f+24>>2]=n,i[f+12>>2]=f,i[f+8>>2]=f;break t}}while(0);w=0|i[(b=n+8|0)>>2],i[w+12>>2]=f,i[b>>2]=f,i[f+8>>2]=w,i[f+12>>2]=n,i[f+24>>2]=0}}while(0);return M=e,0|(w=u+8|0)}h=l}else h=l;else h=-1}while(0);if((r=0|i[6983])>>>0>=h>>>0)return n=r-h|0,t=0|i[6986],n>>>0>15?(w=t+h|0,i[6986]=w,i[6983]=n,i[w+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|h):(i[6983]=0,i[6986]=0,i[t+4>>2]=3|r,i[(w=t+r+4|0)>>2]=1|i[w>>2]),M=e,0|(w=t+8|0);if((a=0|i[6984])>>>0>h>>>0)return v=a-h|0,i[6984]=v,b=(w=0|i[6987])+h|0,i[6987]=b,i[b+4>>2]=1|v,i[w+4>>2]=3|h,M=e,0|(w=w+8|0);if(0|i[7099]?t=0|i[7101]:(i[7101]=4096,i[7100]=4096,i[7102]=-1,i[7103]=-1,i[7104]=0,i[7092]=0,i[7099]=-16&p^1431655768,t=4096),u=h+48|0,(l=(s=t+(c=h+47|0)|0)&(o=0-t|0))>>>0<=h>>>0)return M=e,0|(w=0);if(0|(t=0|i[7091])&&(p=(f=0|i[7089])+l|0)>>>0<=f>>>0|p>>>0>t>>>0)return M=e,0|(w=0);t:do{if(4&i[7092])n=0,y=143;else{r=0|i[6987];e:do{if(r){for(A=28372;!((p=0|i[A>>2])>>>0<=r>>>0&&(p+(0|i[A+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[A+8>>2])){y=128;break e}A=t}if((n=s-a&o)>>>0<2147483647)if((0|(t=0|vn(0|n)))==((0|i[A>>2])+(0|i[A+4>>2])|0)){if(-1!=(0|t)){a=n,s=t,y=145;break t}}else A=t,y=136;else n=0}else y=128}while(0);do{if(128==(0|y))if(-1!=(0|(r=0|vn(0)))&&(n=r,g=(n=((g=(d=0|i[7100])+-1|0)&n|0?(g+n&0-d)-n|0:0)+l|0)+(d=0|i[7089])|0,n>>>0>h>>>0&n>>>0<2147483647)){if(0|(p=0|i[7091])&&g>>>0<=d>>>0|g>>>0>p>>>0){n=0;break}if((0|(t=0|vn(0|n)))==(0|r)){a=n,s=r,y=145;break t}A=t,y=136}else n=0}while(0);do{if(136==(0|y)){if(r=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|A))){if(-1==(0|A)){n=0;break}a=n,s=A,y=145;break t}if((t=c-n+(t=0|i[7101])&0-t)>>>0>=2147483647){a=n,s=A,y=145;break t}if(-1==(0|vn(0|t))){vn(0|r),n=0;break}a=t+n|0,s=A,y=145;break t}}while(0);i[7092]=4|i[7092],y=143}}while(0);if(143==(0|y)&&l>>>0<2147483647&&!(-1==(0|(v=0|vn(0|l)))|1^(m=(_=(g=0|vn(0))-v|0)>>>0>(h+40|0)>>>0)|v>>>0<g>>>0&-1!=(0|v)&-1!=(0|g)^1)&&(a=m?_:n,s=v,y=145),145==(0|y)){n=(0|i[7089])+a|0,i[7089]=n,n>>>0>(0|i[7090])>>>0&&(i[7090]=n),c=0|i[6987];t:do{if(c){for(n=28372;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){y=154;break}if(!(A=0|i[n+8>>2]))break;n=A}if(!(154!=(0|y)||(b=n+4|0,8&i[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[b>>2]=r+a,b=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(w=(0|i[6984])+a|0)-v|0,i[6987]=b,i[6984]=v,i[b+4>>2]=1|v,i[c+w+4>>2]=40,i[6988]=i[7103];break}for(s>>>0<(0|i[6985])>>>0&&(i[6985]=s),r=s+a|0,n=28372;;){if((0|i[n>>2])==(0|r)){y=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|y)&&!(8&i[n+12>>2])){i[n>>2]=s,i[(f=n+4|0)>>2]=(0|i[f>>2])+a,l=(f=s+(7&(f=s+8|0)?0-f&7:0)|0)+h|0,u=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-f-h|0,i[f+4>>2]=3|h;e:do{if((0|c)==(0|n))w=(0|i[6984])+u|0,i[6984]=w,i[6987]=l,i[l+4>>2]=1|w;else{if((0|i[6986])==(0|n)){w=(0|i[6983])+u|0,i[6983]=w,i[6986]=l,i[l+4>>2]=1|w,i[l+w>>2]=w;break}if(1==(3&(t=0|i[n+4>>2]))){a=-8&t,A=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[6981]=i[6981]&~(1<<A);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(A=(r=n+16|0)+4|0)>>2])r=A;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(A=0|i[(o=t+20|0)>>2])t=A,r=o;else{if(!(A=0|i[(o=t+16|0)>>2]))break;t=A,r=o}i[r>>2]=0}else w=0|i[n+8>>2],i[w+12>>2]=t,i[t+8>>2]=w}while(0);if(!s)break;A=28228+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[A>>2])==(0|n)){if(i[A>>2]=t,0|t)break;i[6982]=i[6982]&~(1<<r);break n}if(i[((0|i[(w=s+16|0)>>2])==(0|n)?w:s+20)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(A=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=A,i[A+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+a|0,o=a+u|0}else o=u;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[l+4>>2]=1|o,i[l+o>>2]=o,n=o>>>3,o>>>0<256){r=27964+(n<<1<<2)|0,(t=0|i[6981])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=l,i[n+12>>2]=l,i[l+8>>2]=n,i[l+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){A=31;break}A=o>>>((A=14-((v=((w=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(A=((w<<=v)+245760|0)>>>16&2))+(w<<A>>>15)|0)+7|0)&1|A<<1}else A=0}while(0);if(n=28228+(A<<2)|0,i[l+28>>2]=A,i[(t=l+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[6982])&(r=1<<A))){i[6982]=t|r,i[n>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|o)){for(A=o<<(31==(0|A)?0:25-(A>>>1)|0);t=0|i[(r=n+16+(A>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|o)){n=t;break n}A<<=1,n=t}i[r>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break e}}while(0);w=0|i[(b=n+8|0)>>2],i[w+12>>2]=l,i[b>>2]=l,i[l+8>>2]=w,i[l+12>>2]=n,i[l+24>>2]=0}}while(0);return M=e,0|(w=f+8|0)}for(n=28372;!((t=0|i[n>>2])>>>0<=c>>>0&&(w=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(o=w+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,b=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(r=a+-40|0)-v|0,i[6987]=b,i[6984]=v,i[b+4>>2]=1|v,i[s+r+4>>2]=40,i[6988]=i[7103],i[(r=t+4|0)>>2]=27,i[n>>2]=i[7093],i[n+4>>2]=i[7094],i[n+8>>2]=i[7095],i[n+12>>2]=i[7096],i[7093]=s,i[7094]=a,i[7096]=0,i[7095]=n,n=t+24|0;do{b=n,i[(n=n+4|0)>>2]=7}while((b+8|0)>>>0<w>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=27964+(n<<1<<2)|0,(t=0|i[6981])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[6981]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=28228+((A=(n=s>>>8)?s>>>0>16777215?31:s>>>((A=14-((v=((w=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(A=((w<<=v)+245760|0)>>>16&2))+(w<<A>>>15)|0)+7|0)&1|A<<1:0)<<2)|0,i[c+28>>2]=A,i[c+20>>2]=0,i[o>>2]=0,!((n=0|i[6982])&(t=1<<A))){i[6982]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2])!=(0|s)){for(A=s<<(31==(0|A)?0:25-(A>>>1)|0);t=0|i[(r=n+16+(A>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){n=t;break e}A<<=1,n=t}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);w=0|i[(b=n+8|0)>>2],i[w+12>>2]=c,i[b>>2]=c,i[c+8>>2]=w,i[c+12>>2]=n,i[c+24>>2]=0}}else!(0|(w=0|i[6985]))|s>>>0<w>>>0&&(i[6985]=s),i[7093]=s,i[7094]=a,i[7096]=0,i[6990]=i[7099],i[6989]=-1,i[6994]=27964,i[6993]=27964,i[6996]=27972,i[6995]=27972,i[6998]=27980,i[6997]=27980,i[7e3]=27988,i[6999]=27988,i[7002]=27996,i[7001]=27996,i[7004]=28004,i[7003]=28004,i[7006]=28012,i[7005]=28012,i[7008]=28020,i[7007]=28020,i[7010]=28028,i[7009]=28028,i[7012]=28036,i[7011]=28036,i[7014]=28044,i[7013]=28044,i[7016]=28052,i[7015]=28052,i[7018]=28060,i[7017]=28060,i[7020]=28068,i[7019]=28068,i[7022]=28076,i[7021]=28076,i[7024]=28084,i[7023]=28084,i[7026]=28092,i[7025]=28092,i[7028]=28100,i[7027]=28100,i[7030]=28108,i[7029]=28108,i[7032]=28116,i[7031]=28116,i[7034]=28124,i[7033]=28124,i[7036]=28132,i[7035]=28132,i[7038]=28140,i[7037]=28140,i[7040]=28148,i[7039]=28148,i[7042]=28156,i[7041]=28156,i[7044]=28164,i[7043]=28164,i[7046]=28172,i[7045]=28172,i[7048]=28180,i[7047]=28180,i[7050]=28188,i[7049]=28188,i[7052]=28196,i[7051]=28196,i[7054]=28204,i[7053]=28204,i[7056]=28212,i[7055]=28212,b=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(w=a+-40|0)-v|0,i[6987]=b,i[6984]=v,i[b+4>>2]=1|v,i[s+w+4>>2]=40,i[6988]=i[7103]}while(0);if((n=0|i[6984])>>>0>h>>>0)return v=n-h|0,i[6984]=v,b=(w=0|i[6987])+h|0,i[6987]=b,i[b+4>>2]=1|v,i[w+4>>2]=3|h,M=e,0|(w=w+8|0)}return i[(w=27920)>>2]=12,M=e,0|(w=0)}function Ze(t){var e=0,n=0,r=0,A=0,o=0,s=0,a=0,u=0;if(t|=0){n=t+-8|0,A=0|i[6985],u=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)a=n,s=n;else{if(r=0|i[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<A>>>0)return;if((0|i[6986])==(0|s)){if(3&~(e=0|i[(t=u+4|0)>>2])){a=s,e=o;break}return i[6983]=o,i[t>>2]=-2&e,i[s+4>>2]=1|o,void(i[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[6981]=i[6981]&~(1<<n),a=s,e=o;break}i[t+12>>2]=e,i[e+8>>2]=t,a=s,e=o;break}A=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else a=0|i[s+8>>2],i[a+12>>2]=t,i[t+8>>2]=a}while(0);if(A){if(e=0|i[s+28>>2],(0|i[(n=28228+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[6982]=i[6982]&~(1<<e),a=s,e=o;break}}else if(i[((0|i[(a=A+16|0)>>2])==(0|s)?a:A+20)>>2]=t,!t){a=s,e=o;break}i[t+24>>2]=A,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,a=s,e=o):(a=s,e=o)}else a=s,e=o}}while(0);if(!(s>>>0>=u>>>0)&&1&(r=0|i[(t=u+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[a+4>>2]=1|e,i[s+e>>2]=e,A=e;else{if((0|i[6987])==(0|u)){if(u=(0|i[6984])+e|0,i[6984]=u,i[6987]=a,i[a+4>>2]=1|u,(0|a)!=(0|i[6986]))return;return i[6986]=0,void(i[6983]=0)}if((0|i[6986])==(0|u))return u=(0|i[6983])+e|0,i[6983]=u,i[6986]=s,i[a+4>>2]=1|u,void(i[s+u>>2]=u);A=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[u+8>>2],(0|(t=0|i[u+12>>2]))==(0|e)){i[6981]=i[6981]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}o=0|i[u+24>>2],t=0|i[u+12>>2];do{if((0|t)==(0|u)){if(t=0|i[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[u+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|i[u+28>>2],(0|i[(e=28228+(t<<2)|0)>>2])==(0|u)){if(i[e>>2]=n,!n){i[6982]=i[6982]&~(1<<t);break}}else if(i[((0|i[(r=o+16|0)>>2])==(0|u)?r:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[(t=u+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[a+4>>2]=1|A,i[s+A>>2]=A,(0|a)==(0|i[6986]))return void(i[6983]=A)}if(t=A>>>3,A>>>0<256)return n=27964+(t<<1<<2)|0,(e=0|i[6981])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[6981]=e|t,t=n,e=n+8|0),i[e>>2]=a,i[t+12>>2]=a,i[a+8>>2]=t,void(i[a+12>>2]=n);t=28228+((r=(t=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((o=((u=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((u<<=o)+245760|0)>>>16&2))+(u<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[a+28>>2]=r,i[a+20>>2]=0,i[a+16>>2]=0,e=0|i[6982],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2])!=(0|A)){for(r=A<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|A)){t=e;break e}r<<=1,t=e}i[n>>2]=a,i[a+24>>2]=t,i[a+12>>2]=a,i[a+8>>2]=a;break t}}while(0);u=0|i[(s=t+8|0)>>2],i[u+12>>2]=a,i[s>>2]=a,i[a+8>>2]=u,i[a+12>>2]=t,i[a+24>>2]=0}else i[6982]=e|n,i[t>>2]=a,i[a+24>>2]=t,i[a+12>>2]=a,i[a+8>>2]=a}while(0);if(u=(0|i[6989])-1|0,i[6989]=u,!(0|u)){for(t=28380;t=0|i[t>>2];)t=t+8|0;i[6989]=-1}}}}function tn(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Je(n))&&3&i[t+-4>>2]?(_n(0|t,0,0|n),0|t):0|t}function en(t,e,n,r){return 0|(C((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function nn(t,e,n,r){return 0|(C(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function rn(t){return 0|((t|=0)?31-(0|E(t^t-1)):32)}function An(t,e,n,r,A){A|=0;var o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(l=t|=0,s=n|=0,a=h=r|=0,!(c=u=e|=0))return o=!!(0|A),a?o?(i[A>>2]=0|t,i[A+4>>2]=0&e,A=0,0|(C(0|(h=0)),A)):(A=0,0|(C(0|(h=0)),A)):(o&&(i[A>>2]=(l>>>0)%(s>>>0),i[A+4>>2]=0),A=(l>>>0)/(s>>>0)>>>0,0|(C(0|(h=0)),A));o=!(0|a);do{if(s){if(!o){if((o=(0|E(0|a))-(0|E(0|c))|0)>>>0<=31){s=f=o+1|0,t=l>>>(f>>>0)&(e=o-31>>31)|c<<(a=31-o|0),e&=c>>>(f>>>0),o=0,a=l<<a;break}return A?(i[A>>2]=0|t,i[A+4>>2]=u|0&e,A=0,0|(C(0|(h=0)),A)):(A=0,0|(C(0|(h=0)),A))}if((o=s-1|0)&s|0){s=a=33+(0|E(0|s))-(0|E(0|c))|0,t=(f=32-a|0)-1>>31&c>>>((p=a-32|0)>>>0)|(c<<f|l>>>(a>>>0))&(e=p>>31),e&=c>>>(a>>>0),o=l<<(d=64-a|0)&(u=f>>31),a=(c<<d|l>>>(p>>>0))&u|l<<f&a-33>>31;break}return 0|A&&(i[A>>2]=o&l,i[A+4>>2]=0),1==(0|s)?(d=0|t,0|(C(0|(p=u|0&e)),d)):(p=c>>>((d=0|rn(0|s))>>>0)|0,d=c<<32-d|l>>>(d>>>0),0|(C(0|p),d))}if(o)return 0|A&&(i[A>>2]=(c>>>0)%(s>>>0),i[A+4>>2]=0),d=(c>>>0)/(s>>>0)>>>0,0|(C(0|(p=0)),d);if(!l)return 0|A&&(i[A>>2]=0,i[A+4>>2]=(c>>>0)%(a>>>0)),d=(c>>>0)/(a>>>0)>>>0,0|(C(0|(p=0)),d);if(!((o=a-1|0)&a))return 0|A&&(i[A>>2]=0|t,i[A+4>>2]=o&c|0&e),p=0,d=c>>>((0|rn(0|a))>>>0),0|(C(0|p),d);if((o=(0|E(0|a))-(0|E(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(a=31-o|0)|l>>>(e>>>0),e=c>>>(e>>>0),o=0,a=l<<a;break}return A?(i[A>>2]=0|t,i[A+4>>2]=u|0&e,d=0,0|(C(0|(p=0)),d)):(d=0,0|(C(0|(p=0)),d))}while(0);if(s){c=0|en(0|(f=0|n),0|(l=h|0&r),-1,-1),n=0|I(),u=a,a=0;do{r=u,u=o>>>31|u<<1,o=a|o<<1,nn(0|c,0|n,0|(r=t<<1|r>>>31),0|(h=t>>>31|e<<1)),a=1&(p=(d=0|I())>>31|((0|d)<0?-1:0)<<1),t=0|nn(0|r,0|h,p&f|0,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l),e=0|I(),s=s-1|0}while(0|s);c=u,u=0}else c=a,u=0,a=0;return s=0,0|A&&(i[A>>2]=t,i[A+4>>2]=e),d=o<<1&-2|a,0|(C(0|(p=(0|o)>>>31|(c|s)<<1|u)),d)}function on(t,e,n,r){n|=0;var i,A,o,s,a;return A=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|nn((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0)|0,(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|a,0|s),t=A^a,e=i^s,0|nn((0|An(o,0|I(),0|nn(A^n|0,i^r|0,0|A,0|i),0|I(),0))^t,(0|I())^e,0|t,0|e)}function sn(t,e,n,r){e|=0,r|=0;var i,A;return n=0|function(t,e){var n,r,i,A=0;return t=((n=0|v(A=65535&(e|=0),i=65535&(t|=0)))>>>16)+(0|v(A,r=t>>>16))|0,e=0|v(A=e>>>16,i),0|(C((t>>>16)+(0|v(A,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(i=t|=0,A=n|=0),t=0|I(),0|(C((0|v(e,A))+(0|v(r,i))+t|0&t),n)}function an(t,e,n,r){n|=0;var A,o,s,a,u,c;return A=M,M=M+16|0,a=0|A,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,An(t=0|nn((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0)|0,(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|s,0|o),e=0|I(),0|nn(c^n|0,u^r|0,0|c,0|u),0|I(),a),r=0|nn(i[a>>2]^s|0,i[a+4>>2]^o|0,0|s,0|o),n=0|I(),M=A,0|(C(0|n),r)}function un(t,e,n,r){var A,o;return o=M,M=M+16|0,An(t|=0,e|=0,n|=0,r|=0,A=0|o),M=o,0|(C(0|i[A+4>>2]),i[A>>2])}function cn(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(C(e>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(C(0|((0|e)<0?-1:0)),e>>n-32)}function ln(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(C(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(C(0),e>>>n-32|0)}function fn(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(C(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(C(t<<n-32),0)}function hn(t,e,n){return t|=0,32==(0|(e=0|E(e|=0)))&&(e=e+(0|E(t))|0),C(0),0|e}function pn(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+w(+t,+e)}function dn(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function gn(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function yn(t,e,n){t|=0,e|=0;var A,o,s=0;if((0|(n|=0))>=8192)return D(0|t,0|e,0|n),0|t;if(o=0|t,A=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&A)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=A-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|A);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function _n(t,e,n){e|=0;var A,o=0,s=0,a=0;if(A=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(a=e|e<<8|e<<16|e<<24,s=(o=-4&A)-64|0;(0|t)<=(0|s);)i[t>>2]=a,i[t+4>>2]=a,i[t+8>>2]=a,i[t+12>>2]=a,i[t+16>>2]=a,i[t+20>>2]=a,i[t+24>>2]=a,i[t+28>>2]=a,i[t+32>>2]=a,i[t+36>>2]=a,i[t+40>>2]=a,i[t+44>>2]=a,i[t+48>>2]=a,i[t+52>>2]=a,i[t+56>>2]=a,i[t+60>>2]=a,t=t+64|0;for(;(0|t)<(0|o);)i[t>>2]=a,t=t+4|0}for(;(0|t)<(0|A);)r[t|0]=e,t=t+1|0;return A-n|0}function mn(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function vn(t){t|=0;var e,n,r;return r=0|N(),(0|t)>0&(0|(e=(n=0|i[s>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),S(12),-1):(0|e)>(0|r)&&!(0|L(0|e))?(S(12),-1):(i[s>>2]=e,0|n)}return{___divdi3:on,___muldi3:sn,___remdi3:an,___uremdi3:un,_areNeighborCells:function(t,e,n,r,A){A|=0;var o,s,a,u=0,c=0,l=0,f=0;if(a=M,M=M+64|0,s=a,o=a+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return M=a,0|(A=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return i[A>>2]=0,M=a,0|(A=0);if(c=0|ln(0|t,0|e,52),I(),c&=15,f=0|ln(0|n,0|r,52),I(),(0|c)!=(15&f))return M=a,0|(A=12);if(u=c+-1|0,c>>>0>1){Vt(t,e,u,s),Vt(n,r,u,o),l=0|i[(f=s)>>2],f=0|i[f+4>>2];t:do{if((0|l)==(0|i[o>>2])&&(0|f)==(0|i[o+4>>2])){u=0|ln(0|t,0|e,0|(c=3*(15^c)|0)),I(),u&=7,c=0|ln(0|n,0|r,0|c),I(),c&=7;do{if(!(0|u)|!(0|c))i[A>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|jt(l,f)){u=5;break}if((0|i[15536+(u<<2)>>2])!=(0|c)&&(0|i[15568+(u<<2)>>2])!=(0|c))break t;i[A>>2]=1,u=0}}while(0);return M=a,0|(A=u)}}while(0)}c=(u=s)+56|0;do{i[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return O(t,e,1,s),u=(0|i[(e=s)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+8|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+16|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+24|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+32|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+40|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)?1:1&((0|i[(u=s+48|0)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0),i[A>>2]=u,M=a,0|(A=0)},_bitshift64Ashr:cn,_bitshift64Lshr:ln,_bitshift64Shl:fn,_calloc:tn,_cellAreaKm2:function(t,e,n){return 0|(t=0|ye(t|=0,e|=0,n|=0))||(A[n>>3]=6371.007180918475*+A[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|ye(t|=0,e|=0,n|=0))||(A[n>>3]=6371.007180918475*+A[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:ye,_cellToBoundary:Ae,_cellToCenterChild:Xt,_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0;if(A=M,M=M+16|0,_=A,m=0|ln(0|(t|=0),0|(e|=0),52),I(),m&=15,n>>>0>15)return M=A,0|(m=4);if((0|m)<(0|n))return M=A,0|(m=12);if((0|m)!=(0|n))if(s=0|fn(0|n,0,52),s|=t,u=I()|-15728641&e,(0|m)>(0|n)){c=n;do{y=0|fn(7,0,3*(14-c|0)|0),c=c+1|0,s|=y,u=0|I()|u}while((0|c)<(0|m));y=s}else y=s;else y=t,u=e;g=0|ln(0|y,0|u,45),I();t:do{if(0|z(127&g)){if(c=0|ln(0|y,0|u,52),I(),0|(c&=15))for(s=1;;){if(!(!((g=0|fn(7,0,3*(15-s|0)|0))&y|0)&!((0|I())&u))){l=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(i[(g=r)>>2]=0,i[g+4>>2]=0,(0|m)>(0|n)){for(g=-15728641&e,d=m;;){if(p=d,(d=d+-1|0)>>>0>15|(0|m)<(0|d)){l=19;break}if((0|m)!=(0|d))if(s=0|fn(0|d,0,52),s|=t,c=0|I()|g,(0|m)<(0|p))h=s;else{l=d;do{h=0|fn(7,0,3*(14-l|0)|0),l=l+1|0,s|=h,c=0|I()|c}while((0|l)<(0|m));h=s}else h=t,c=e;if(f=0|ln(0|h,0|c,45),I(),0|z(127&f)){f=0|ln(0|h,0|c,52),I(),f&=15;e:do{if(f)for(l=1;;){if(s=0|ln(0|h,0|c,3*(15-l|0)|0),I(),0|(s&=7))break e;if(!(l>>>0<f>>>0)){s=0;break}l=l+1|0}else s=0}while(0);s=1&!(0|s)}else s=0;if(c=0|ln(0|t,0|e,3*(15-p|0)|0),I(),7==(0|(c&=7))){o=5,l=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,l=42;break}if(0|(h=c+((!!(0|c)&s)<<31>>31)|0)&&(l=0|Ie(7,0,l=m-p|0,((0|l)<0)<<31>>31),f=0|I(),s?(s=0|en(0|(s=0|sn(0|l,0|f,5,0)),0|I(),-5,-1),s=0|en(0|(s=0|on(0|s,0|I(),6,0)),0|I(),1,0),c=0|I()):(s=l,c=f),p=0|en(0|s,0|c,0|(p=0|sn(0|l,0|f,0|(p=h+-1|0),((0|p)<0)<<31>>31)),0|I()),f=0|en(0|p,0|(h=0|I()),0|i[(f=r)>>2],0|i[f+4>>2]),h=0|I(),i[(p=r)>>2]=f,i[p+4>>2]=h),(0|d)<=(0|n)){l=37;break}}if(19==(0|l))x(27795,27122,1367,27158);else{if(37==(0|l)){o=0|i[(a=r)+4>>2],a=0|i[a>>2];break}if(42==(0|l))return M=A,0|o}}else o=0,a=0}else l=33}while(0);t:do{if(33==(0|l)){if(i[(g=r)>>2]=0,i[g+4>>2]=0,(0|m)>(0|n)){for(s=m;;){if(o=0|ln(0|t,0|e,3*(15-s|0)|0),I(),7==(0|(o&=7))){o=5;break}if(o=0|sn(0|(a=0|Ie(7,0,a=m-s|0,((0|a)<0)<<31>>31)),0|I(),0|o,0),a=0|I(),a=0|en(0|i[(g=r)>>2],0|i[g+4>>2],0|o,0|a),o=0|I(),i[(g=r)>>2]=a,i[g+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return M=A,0|o}o=0,a=0}}while(0);return 0|Yt(y,u,m,_)&&x(27795,27122,1327,27173),((0|o)>-1|-1==(0|o)&a>>>0>4294967295)&((0|(_=0|i[(m=_)+4>>2]))>(0|o)|((0|_)==(0|o)?(0|i[m>>2])>>>0>a>>>0:0))?(M=A,0|(m=0)):(x(27795,27122,1407,27158),0)},_cellToChildren:function(t,e,n,r){r|=0;var A,o,s=0,a=0;if(o=M,M=M+16|0,se(A=o,t|=0,e|=0,n|=0),!(0|(t=0|i[(e=A)>>2]))&!(0|(e=0|i[e+4>>2])))return M=o,0;s=0,n=0;do{i[(a=r+(s<<3)|0)>>2]=t,i[a+4>>2]=e,s=0|en(0|s,0|n,1,0),n=0|I(),ue(A),t=0|i[(a=A)>>2],e=0|i[a+4>>2]}while(!(!(0|t)&!(0|e)));return M=o,0},_cellToChildrenSize:Yt,_cellToLatLng:ie,_cellToLocalIj:function(t,e,n,r,i,A){var o,s;return t|=0,e|=0,n|=0,r|=0,A|=0,s=M,M=M+16|0,o=s,(i|=0)?t=15:(t=0|Ee(t,e,n,r,o))||(xt(o,A),t=0),M=s,0|t},_cellToParent:Vt,_cellToVertex:ze,_cellToVertexes:function(t,e,n){n|=0;var r,A=0,o=0;return o=!(0|jt(t|=0,e|=0)),r=!(0|(A=0|ze(t,e,0,n))),o?r?0|(A=0|ze(t,e,1,n+8|0))||0|(A=0|ze(t,e,2,n+16|0))||0|(A=0|ze(t,e,3,n+24|0))||(A=0|ze(t,e,4,n+32|0))?0|(o=A):0|ze(t,e,5,n+40|0):0|(o=A):r?0|(A=0|ze(t,e,1,n+8|0))||0|(A=0|ze(t,e,2,n+16|0))||0|(A=0|ze(t,e,3,n+24|0))||0|(A=0|ze(t,e,4,n+32|0))?0|(o=A):(i[(o=n+40|0)>>2]=0,i[o+4>>2]=0,0|(o=0)):0|(o=A)},_cellsToDirectedEdge:function(t,e,n,r,A){return A|=0,7==(0|(n=0|U(t|=0,e|=0,n|=0,r|=0)))?0|(A=11):(r=0|fn(0|n,0,56),e=-2130706433&e|I()|268435456,i[A>>2]=t|r,i[A+4>>2]=e,0|(A=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,A,o,s=0;if(o=M,M=M+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,A,o=0,s=0,a=0,u=0,c=0,l=0;if(A=M,M=M+176|0,r=A,(0|(e|=0))<1)return Ve(n,0,0),M=A,0;for(c=0|ln(0|i[(c=t)>>2],0|i[c+4>>2],52),I(),Ve(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Ae(0|i[(o=t+(c<<3)|0)>>2],0|i[o+4>>2],r)));){if((0|(o=0|i[r>>2]))>0){u=0;do{a=r+8+(u<<4)|0,(s=0|We(n,o=r+8+((0|(u=u+1|0))%(0|o)<<4)|0,a))?He(n,s):Xe(n,a,o),o=0|i[r>>2]}while((0|u)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,l=13;break}}return 13==(0|l)?(M=A,0|o):(Ye(n),M=A,0|(l=o))}(t|=0,e|=0,A=o+16|0),0|t)return M=o,0|(n=t);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(t=0|je(A)))do{e=0|_e(n);do{me(e,t),s=t+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],He(A,t),t=0|$e(A,r)}while(0|t);t=0|je(A)}while(0|t);return Ye(A),(t=0|be(n))?(ve(n),M=o,0|(s=t)):(M=o,0|(s=0))},_childPosToCell:function(t,e,n,r,A,o){t|=0,e|=0,o|=0;var s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,a=s,(A|=0)>>>0>15)return M=s,0|(o=4);if(u=0|ln(0|(n|=0),0|(r|=0),52),I(),(0|(u&=15))>(0|A))return M=s,0|(o=12);if(0|Yt(n,r,A,a)&&x(27795,27122,1327,27173),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(l=0|i[(f=a)+4>>2]))>(0|e)|((0|l)==(0|e)?(0|i[f>>2])>>>0>t>>>0:0))))return M=s,0|(o=2);f=A-u|0,A=0|fn(0|A,0,52),c=I()|-15728641&r,i[(l=o)>>2]=A|n,i[l+4>>2]=c,l=0|ln(0|n,0|r,45),I();t:do{if(0|z(127&l)){if(0|u)for(a=1;;){if(!(!((l=0|fn(7,0,3*(15-a|0)|0))&n|0)&!((0|I())&r)))break t;if(!(a>>>0<u>>>0))break;a=a+1|0}if((0|f)<1)return M=s,0|(o=0);for(l=15^u,r=-1,c=1,a=1;;){u=0|Ie(7,0,u=f-c|0,((0|u)<0)<<31>>31),n=0|I();do{if(a){if(a=0|on(0|(a=0|en(0|(a=0|sn(0|u,0|n,5,0)),0|I(),-5,-1)),0|I(),6,0),(0|e)>(0|(A=0|I()))|(0|e)==(0|A)&t>>>0>a>>>0){e=0|nn(0|(e=0|en(0|t,0|e,-1,-1)),0|I(),0|a,0|A),a=0|I(),d=0|i[(h=o)>>2],h=0|i[h+4>>2],p=0|fn(7,0,0|(g=3*(l+r|0)|0)),h&=~I(),g=0|fn(0|(A=0|en(0|(r=0|on(0|e,0|a,0|u,0|n)),0|(t=0|I()),2,0)),0|I(),0|g),h=0|I()|h,i[(A=o)>>2]=g|d&~p,i[A+4>>2]=h,t=0|nn(0|e,0|a,0|(t=0|sn(0|r,0|t,0|u,0|n)),0|I()),a=0,e=0|I();break}p=0|i[(g=o)>>2],g=0|i[g+4>>2],d=0|fn(7,0,3*(l+r|0)|0),g&=~I(),i[(a=o)>>2]=p&~d,i[a+4>>2]=g,a=1;break}A=0|i[(p=o)>>2],p=0|i[p+4>>2],h=0|fn(7,0,0|(r=3*(l+r|0)|0)),p&=~I(),r=0|fn(0|(g=0|on(0|t,0|e,0|u,0|n)),0|(a=0|I()),0|r),p=0|I()|p,i[(d=o)>>2]=r|A&~h,i[d+4>>2]=p,t=0|nn(0|t,0|e,0|(a=0|sn(0|g,0|a,0|u,0|n)),0|I()),a=0,e=0|I()}while(0);if(!((0|f)>(0|c))){e=0;break}r=~c,c=c+1|0}return M=s,0|e}}while(0);if((0|f)<1)return M=s,0|(g=0);for(A=15^u,a=1;;){if(d=0|Ie(7,0,d=f-a|0,((0|d)<0)<<31>>31),g=0|I(),n=0|i[(c=o)>>2],c=0|i[c+4>>2],r=0|fn(7,0,0|(u=3*(A-a|0)|0)),c&=~I(),u=0|fn(0|(h=0|on(0|t,0|e,0|d,0|g)),0|(p=0|I()),0|u),c=0|I()|c,i[(l=o)>>2]=u|n&~r,i[l+4>>2]=c,t=0|nn(0|t,0|e,0|(g=0|sn(0|h,0|p,0|d,0|g)),0|I()),e=0|I(),(0|f)<=(0|a)){e=0;break}a=a+1|0}return M=s,0|e},_compactCells:function(t,e,n,r){e|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,S=0,N=0,D=0,L=0,T=0,M=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(M=0);if(s=0|i[(o=t|=0)>>2],!0&!(15728640&(o=0|i[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(M=0);if(i[(M=e)>>2]=s,i[M+4>>2]=o,1==(0|n)&!(0|r))return 0|(M=0);o=1,s=0;do{T=0|i[(L=t+(o<<3)|0)+4>>2],i[(M=e+(o<<3)|0)>>2]=i[L>>2],i[M+4>>2]=T,o=0|en(0|o,0|s,1,0),s=0|I()}while((0|s)<(0|r)|(0|s)==(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(T=0|Je(A=n<<3)))return 0|(M=13);if(yn(0|T,0|t,0|A),!(L=0|tn(n,8)))return Ze(T),0|(M=13);t:for(;;){N=0|ln(0|(l=0|i[(o=T)>>2]),0|(o=0|i[o+4>>2]),52),I(),D=(N&=15)+-1|0,S=!!(0|N),C=(0|r)>0|!(0|r)&n>>>0>0;e:do{if(S&C){if(v=0|fn(0|D,0,52),b=0|I(),D>>>0>15){if(!(!(0|l)&!(0|o))){M=16;break t}for(s=0,t=0;;){if(s=0|en(0|s,0|t,1,0),!((0|(t=0|I()))<(0|r)|(0|t)==(0|r)&s>>>0<n>>>0))break e;if(!(!(0|(E=0|i[(a=T+(s<<3)|0)>>2]))&!(0|(a=0|i[a+4>>2])))){o=a,M=16;break t}}}for(u=l,t=o,s=0,a=0;;){if(!(!(0|u)&!(0|t))){if(!(!0&!(117440512&t))){M=21;break t}if(f=0|ln(0|u,0|t,52),I(),(0|(f&=15))<(0|D)){o=12,M=27;break t}if((0|f)!=(0|D)&&(u|=v,t=-15728641&t|b,f>>>0>=N>>>0)){c=D;do{E=0|fn(7,0,3*(14-c|0)|0),c=c+1|0,u|=E,t=0|I()|t}while(c>>>0<f>>>0)}if(p=0|un(0|u,0|t,0|n,0|r),d=0|I(),!(!(0|(h=0|i[(f=c=L+(p<<3)|0)>>2]))&!(0|(f=0|i[f+4>>2])))){_=0,m=0;do{if((0|_)>(0|r)|(0|_)==(0|r)&m>>>0>n>>>0){M=31;break t}if((0|h)==(0|u)&(-117440513&f)==(0|t)){g=0|ln(0|h,0|f,56),I(),y=(g&=7)+1|0,E=0|ln(0|h,0|f,45),I();n:do{if(0|z(127&E)){if(h=0|ln(0|h,0|f,52),I(),!(h&=15)){f=6;break}for(f=1;;){if(!(!((E=0|fn(7,0,3*(15-f|0)|0))&u|0)&!((0|I())&t))){f=7;break n}if(!(f>>>0<h>>>0)){f=6;break}f=f+1|0}}else f=7}while(0);if((g+2|0)>>>0>f>>>0){M=41;break t}E=0|fn(0|y,0,56),t=I()|-117440513&t,i[(w=c)>>2]=0,i[w+4>>2]=0,u|=E}else p=0|an(0|(p=0|en(0|p,0|d,1,0)),0|I(),0|n,0|r),d=0|I();m=0|en(0|m,0|_,1,0),_=0|I(),h=0|i[(f=c=L+(p<<3)|0)>>2],f=0|i[f+4>>2]}while(!(!(0|h)&!(0|f)))}i[(E=c)>>2]=u,i[E+4>>2]=t}if(s=0|en(0|s,0|a,1,0),!((0|(a=0|I()))<(0|r)|(0|a)==(0|r)&s>>>0<n>>>0))break e;u=0|i[(t=T+(s<<3)|0)>>2],t=0|i[t+4>>2]}}}while(0);if(E=0|en(0|n,0|r,5,0),(w=0|I())>>>0<0|!(0|w)&E>>>0<11){M=85;break}if(E=0|on(0|n,0|r,6,0),I(),!(E=0|tn(E,8))){M=48;break}do{if(C){for(y=0,t=0,g=0,_=0;;){if(!(0|(s=0|i[(a=f=L+(y<<3)|0)>>2]))&!(0|(a=0|i[a+4>>2])))w=g;else{h=0|ln(0|s,0|a,56),I(),u=(h&=7)+1|0,p=-117440513&a,w=0|ln(0|s,0|a,45),I();e:do{if(0|z(127&w)){if(d=0|ln(0|s,0|a,52),I(),0|(d&=15))for(c=1;;){if(!(!(s&(w=0|fn(7,0,3*(15-c|0)|0))|0)&!(p&(0|I()))))break e;if(!(c>>>0<d>>>0))break;c=c+1|0}s|=a=0|fn(0|u,0,56),a=0|I()|p,i[(u=f)>>2]=s,i[u+4>>2]=a,u=h+2|0}}while(0);7==(0|u)?(i[(w=E+(t<<3)|0)>>2]=s,i[w+4>>2]=-117440513&a,t=0|en(0|t,0|g,1,0),w=0|I()):w=g}if(y=0|en(0|y,0|_,1,0),!((0|(_=0|I()))<(0|r)|(0|_)==(0|r)&y>>>0<n>>>0))break;g=w}if(C){if(m=D>>>0>15,v=0|fn(0|D,0,52),b=0|I(),!S){for(s=0,c=0,u=0,a=0;!(0|l)&!(0|o)||(i[(D=e+(s<<3)|0)>>2]=l,i[D+4>>2]=o,s=0|en(0|s,0|c,1,0),c=0|I()),u=0|en(0|u,0|a,1,0),(0|(a=0|I()))<(0|r)|(0|a)==(0|r)&u>>>0<n>>>0;)l=0|i[(o=T+(u<<3)|0)>>2],o=0|i[o+4>>2];o=w;break}for(s=0,c=0,a=0,u=0;;){do{if(!(!(0|l)&!(0|o))){if(d=0|ln(0|l,0|o,52),I(),m|(0|(d&=15))<(0|D)){M=80;break t}if((0|d)!=(0|D)){if(f=l|v,h=-15728641&o|b,d>>>0>=N>>>0){p=D;do{S=0|fn(7,0,3*(14-p|0)|0),p=p+1|0,f|=S,h=0|I()|h}while(p>>>0<d>>>0)}}else f=l,h=o;g=0|un(0|f,0|h,0|n,0|r),p=0,d=0,_=0|I();do{if((0|p)>(0|r)|(0|p)==(0|r)&d>>>0>n>>>0){M=81;break t}if((-117440513&(y=0|i[(S=L+(g<<3)|0)+4>>2]))==(0|h)&&(0|i[S>>2])==(0|f)){M=65;break}g=0|an(0|(S=0|en(0|g,0|_,1,0)),0|I(),0|n,0|r),_=0|I(),d=0|en(0|d,0|p,1,0),p=0|I(),S=L+(g<<3)|0}while((0|i[S>>2])!=(0|f)||(0|i[S+4>>2])!=(0|h));if(65==(0|M)&&(M=0,!0&100663296==(117440512&y)))break;i[(S=e+(s<<3)|0)>>2]=l,i[S+4>>2]=o,s=0|en(0|s,0|c,1,0),c=0|I()}}while(0);if(a=0|en(0|a,0|u,1,0),!((0|(u=0|I()))<(0|r)|(0|u)==(0|r)&a>>>0<n>>>0))break;l=0|i[(o=T+(a<<3)|0)>>2],o=0|i[o+4>>2]}o=w}else s=0,o=w}else s=0,t=0,o=0}while(0);if(_n(0|L,0,0|A),yn(0|T,0|E,t<<3),Ze(E),!(0|t)&!(0|o)){M=89;break}e=e+(s<<3)|0,r=o,n=t}if(16==(0|M))!0&!(117440512&o)?(o=4,M=27):M=21;else if(31==(0|M))x(27795,27122,620,27132);else{if(41==(0|M))return Ze(T),Ze(L),0|(M=10);if(48==(0|M))return Ze(T),Ze(L),0|(M=13);80==(0|M)?x(27795,27122,711,27132):81==(0|M)?x(27795,27122,723,27132):85==(0|M)&&(yn(0|e,0|T,n<<3),M=89)}return 21==(0|M)?(Ze(T),Ze(L),0|(M=5)):27==(0|M)?(Ze(T),Ze(L),0|(M=o)):89==(0|M)?(Ze(T),Ze(L),0|(M=0)):0},_constructCell:function(t,e,n,A){n|=0,A|=0;var o=0,s=0,a=0,u=0,c=0,l=0;if((t|=0)>>>0>15)return 0|(A=4);if((e|=0)>>>0>121)return 0|(A=17);a=0|fn(0|t,0,52),o=0|I(),u=0|fn(0|e,0,45),o=0|o|I()|134225919;t:do{if((0|t)>=1){for(u=1,a=!!(0|r[20528+e|0]),s=-1;;){if((e=0|i[n+(u+-1<<2)>>2])>>>0>6){o=18,e=10;break}if(!(!(0|e)|1^a)){if(1==(0|e)){o=19,e=10;break}a=0}if(c=0|fn(7,0,0|(l=3*(15-u|0)|0)),o&=~I(),s=(e=0|fn(0|e,((0|e)<0)<<31>>31,0|l))|s&~c,o=0|I()|o,!((0|u)<(0|t)))break t;u=u+1|0}if(10==(0|e))return 0|o}else s=-1}while(0);return i[(l=A)>>2]=s,i[l+4>>2]=o,0|(l=0)},_destroyLinkedMultiPolygon:ve,_directedEdgeToBoundary:Tt,_directedEdgeToCells:function(t,e,n){t|=0;var r,A,o,s=0;return r=M,M=M+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(A=-2130706433&e|134217728,i[(o=n|=0)>>2]=t,i[o+4>>2]=A,i[s>>2]=0,e=0|ln(0|t,0|e,56),I(),s=0|B(t,A,7&e,s,n+8|0),M=r,0|s):(M=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|Tt(t|=0,e|=0,u=r)))return u=t,a=+A[n>>3],a*=6371.007180918475,A[n>>3]=a,M=r,0|u;if(A[n>>3]=0,(0|(t=0|i[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,A[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+A[u+8>>3],s=+A[u+16>>3],a=0;do{p=o,o=+A[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+A[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return A[n>>3]=a,u=0,d=a,d*=6371.007180918475,A[n>>3]=d,M=r,0|u},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|Tt(t|=0,e|=0,u=r)))return u=t,a=+A[n>>3],a*=6371.007180918475,a*=1e3,A[n>>3]=a,M=r,0|u;if(A[n>>3]=0,(0|(t=0|i[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,a*=1e3,A[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+A[u+8>>3],s=+A[u+16>>3],a=0;do{p=o,o=+A[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+A[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return A[n>>3]=a,u=0,d=a,d*=6371.007180918475,d*=1e3,A[n>>3]=d,M=r,0|u},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|Tt(t|=0,e|=0,u=r)))return M=r,0|(u=t);if(A[n>>3]=0,(0|(t=0|i[u>>2]))<=1)return M=r,0|(u=0);e=t+-1|0,t=0,o=+A[u+8>>3],s=+A[u+16>>3],a=0;do{p=o,o=+A[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+A[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+o)*+f(+p)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)<(0|e));return A[n>>3]=a,M=r,0|(u=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),i=new Int32Array(t),A=new Float64Array(t),n=t,!0},_free:Ze,_getBaseCellNumber:Qt,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,A,o=0;return r=M,M=M+16|0,i[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(A=0|ln(0|t,0|e,56),I(),o=0|B(t,-2130706433&e|134217728,7&A,o,n),M=r,0|o):(M=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(i[n>>2]=t,i[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:pe,_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[20912+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(A[e>>3]=+A[21040+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var A,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;A=M,M=M+128|0,f=A+112|0,a=A+96|0,h=A,s=0|ln(0|(e|=0),0|(n|=0),52),I(),c=15&s,i[f>>2]=c,u=0|ln(0|e,0|n,45),I(),u&=127;t:do{if(0|z(u)){if(0|c)for(o=1;;){if(!(!((l=0|fn(7,0,3*(15-o|0)|0))&e|0)&!((0|I())&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return l=0|fn(c+1|0,0,52),h=I()|-15728641&n,h=0|t((l|e)&~(f=0|fn(7,0,3*(14-c|0)|0)),h&~I(),r),M=A,0|h;s=1}else s=0}while(0);if(!(o=0|re(e,n,a))){s?(kt(a,f,h),l=5):(Ut(a,f,h),l=6);t:do{if(0|z(u))if(c)for(o=1;;){if(!(!((u=0|fn(7,0,3*(15-o|0)|0))&e|0)&!((0|I())&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);_n(0|r,-1,e<<2);t:do{if(s)for(a=0;;){if(Ft(u=h+(a<<4)|0,0|i[f>>2]),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}else for(a=0;;){if(Bt(u=h+(a<<4)|0,0|i[f>>2],0,1),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}}while(0)}return M=A,0|(h=o)},_getIndexDigit:function(t,e,n,r){return r|=0,((n|=0)+-1|0)>>>0>14?0|(r=4):(n=0|ln(0|(t|=0),0|(e|=0),3*(15-n|0)|0),I(),i[r>>2]=7&n,0|(r=0))},_getNumCells:de,_getPentagons:oe,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{fn(0|e,0,45),r=134225919|I(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|ln(0|(t|=0),0|(e|=0),52),I(),15&e},_greatCircleDistanceKm:he,_greatCircleDistanceM:function(t,e){t|=0;var n,r,i,o=0;return r=+A[(e|=0)>>3],n=+A[t>>3],o=(i=+h(.5*(r-n)))*i+(o=+h(.5*(+A[e+8>>3]-+A[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,i,o=0;return r=+A[(e|=0)>>3],n=+A[t>>3],o=(i=+h(.5*(r-n)))*i+(o=+h(.5*(+A[e+8>>3]-+A[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:P,_gridDistance:function(t,e,n,r,A){n|=0,r|=0,A|=0;var o,s,a=0,u=0;return s=M,M=M+32|0,u=s,0|(o=0|Ee(t|=0,e|=0,t,e,a=s+12|0))?(M=s,0|(u=o)):0|(t=0|Ee(t,e,n,r,u))?(M=s,0|(u=t)):(a=0|It(a,u),i[(u=A)>>2]=a,i[u+4>>2]=((0|a)<0)<<31>>31,M=s,0|(u=0))},_gridPathCells:function(t,e,n,r,A){n|=0,r|=0,A|=0;var o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,S=0,N=0;if(s=M,M=M+48|0,c=s+12|0,S=s,!(a=0|Ee(t|=0,e|=0,t,e,o=s+24|0))&&!(a=0|Ee(t,e,n,r,c))){C=((0|(E=0|It(o,c)))<0)<<31>>31,i[o>>2]=0,i[o+4>>2]=0,i[o+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|Ee(t,e,t,e,o)&&x(27795,27538,692,27747),0|Ee(t,e,n,r,c)&&x(27795,27538,697,27747),Nt(o),Nt(c),p=0|E?1/+(0|E):0,n=0|i[o>>2],m=p*+((0|i[c>>2])-n|0),r=0|i[(v=o+4|0)>>2],b=p*+((0|i[c+4>>2])-r|0),a=0|i[(w=o+8|0)>>2],p*=+((0|i[c+8>>2])-a|0),i[S>>2]=n,i[(d=S+4|0)>>2]=r,i[(g=S+8|0)>>2]=a;t:do{if((0|E)<0)a=0;else for(y=0,_=0;;){N=m*(f=+(_>>>0)+4294967296*+(0|y))+ +(0|n),l=b*f+ +(0|r),f=p*f+ +(0|a),n=~~+gn(+N),c=~~+gn(+l),a=~~+gn(+f),N=+u(+(+(0|n)-N)),l=+u(+(+(0|c)-l)),f=+u(+(+(0|a)-f));do{if(!(N>l&N>f)){if(h=0-n|0,l>f){r=h-a|0;break}r=c,a=h-c|0;break}n=0-(c+a)|0,r=c}while(0);if(i[S>>2]=n,i[d>>2]=r,i[g>>2]=a,Dt(S),0|(a=0|Ce(t,e,S,A+(_<<3)|0)))break t;if(!((0|y)<(0|C)|(0|y)==(0|C)&_>>>0<E>>>0)){a=0;break t}n=0|en(0|_,0|y,1,0),y=r=0|I(),_=n,n=0|i[o>>2],r=0|i[v>>2],a=0|i[w>>2]}}while(0);return M=s,0|(S=a)}return M=s,0|(S=a)},_gridPathCellsSize:function(t,e,n,r,A){n|=0,r|=0,A|=0;var o,s=0,a=0,u=0;return o=M,M=M+32|0,u=o,(s=0|Ee(t|=0,e|=0,t,e,a=o+12|0))||(s=0|Ee(t,e,n,r,u))?(M=o,0|(u=s)):(r=0|en(0|(r=0|It(a,u)),((0|r)<0)<<31>>31,1,0),a=0|I(),i[(u=A)>>2]=r,i[u+4>>2]=a,M=o,0|(u=0))},_gridRing:function(t,e,n,r){return 0|F(t|=0,e|=0,n|=0,r|=0)?(_n(0|r,0,48*n|0),0|(r=0|G(t,e,n,r))):0|(r=0)},_gridRingUnsafe:F,_i64Add:en,_i64Subtract:nn,_isPentagon:jt,_isResClassIII:function(t,e){return e=0|ln(0|(t|=0),0|(e|=0),52),I(),1&e},_isValidCell:zt,_isValidDirectedEdge:Lt,_isValidIndex:function(t,e){t|=0;var n=0,i=0,A=0,o=0;if(!0&134217728==(-16777216&(e|=0))&&(i=0|ln(0|t,0|e,52),I(),i&=15,n=0|ln(0|t,0|e,45),I(),(n&=127)>>>0<=121)&&!(613566756&(o=0|fn(0|(A=0|ln(0|t,0|e,0|(o=3*(15^i)|0))),0|I(),0|o))&(0|nn(-1227133514,-1171,0|o,0|(A=0|I()))))&!(4681&A&I())&&15==(0|i)|!(0|(o=0|ln(0|(0|fn(0|~t,0|~e,0|(o=19+(3*i|0)|0))),0|I(),0|o)))&!(0|I())){if(!(0|r[20528+n|0]))return 0|(o=1);if(!(0|t)&!(0|(n=8191&e)))return 0|(o=1);if(o=0|hn(0|t,0|n),I(),(63-o|0)%3|0)return 0|(o=1)}return 0|Lt(t,e)?0|(o=1):0|(o=1&!!(0|qe(t,e)))},_isValidVertex:qe,_latLngToCell:ee,_llvm_ctlz_i64:hn,_llvm_maxnum_f64:pn,_llvm_minnum_f64:dn,_llvm_round_f64:gn,_localIjToCell:function(t,e,n,r,i){var A,o;return t|=0,e|=0,n|=0,i|=0,o=M,M=M+16|0,A=o,(r|=0)?n=15:(n=0|St(n,A))||(n=0|Ce(t,e,A,i)),M=o,0|n},_malloc:Je,_maxFaceCount:function(t,e,n){n|=0;var r=0,A=0;if(A=0|ln(0|(t|=0),0|(e|=0),45),I(),!(0|z(127&A)))return A=2,i[n>>2]=A,0;if(A=0|ln(0|t,0|e,52),I(),!(A&=15))return A=5,i[n>>2]=A,0;for(r=1;;){if(!(!((0|fn(7,0,3*(15-r|0)|0))&t|0)&!((0|I())&e))){r=2,t=6;break}if(!(r>>>0<A>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,A=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|de(15,e)):(A=0|sn(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|I(),n=0|en(0|t,0|n,1,0),n=0|en(0|(n=0|sn(0|A,0|r,0|n,0|I())),0|I(),1,0),t=0|I(),i[e>>2]=n,i[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){t|=0,e|=0,r|=0;var A,o=0,s=0,a=0,u=0,c=0;if(A=M,M=M+48|0,o=A+16|0,s=A+8|0,a=A,0|(n=0|Me(n|=0)))return M=A,0|(a=n);if(u=0|i[(c=t)+4>>2],i[(n=s)>>2]=i[c>>2],i[n+4>>2]=u,Te(s,o),!(n=0|nt(o,e,a))){if(e=0|i[s>>2],(0|(s=0|i[t+8>>2]))>0){o=0|i[t+12>>2],n=0;do{e=(0|i[o+(n<<3)>>2])+e|0,n=n+1|0}while((0|n)<(0|s))}o=0|i[(n=a)>>2],(0|(n=0|i[n+4>>2]))<(0|(s=((0|e)<0)<<31>>31))|(0|n)==(0|s)&o>>>0<e>>>0?(i[(n=a)>>2]=e,i[n+4>>2]=s,n=s):e=o,u=0|en(0|e,0|n,12,0),c=0|I(),i[(n=a)>>2]=u,i[n+4>>2]=c,i[(n=r)>>2]=u,i[n+4>>2]=c,n=0}return M=A,0|(c=n)},_maxPolygonToCellsSizeExperimental:function(t,e,n,o){e|=0,n|=0,o|=0;var s,a,c=0,l=0,h=0,p=0,d=0,g=0,y=0,_=0;if(a=M,M=M+48|0,d=a+32|0,p=a+40|0,s=a,!(0|i[(t|=0)>>2]))return i[(g=o)>>2]=0,i[g+4>>2]=0,M=a,0|(g=0);qt(d,0,0,0),c=0|i[(h=d)>>2],h=0|i[h+4>>2];do{if(e>>>0>15)i[(g=s)>>2]=0,i[g+4>>2]=0,i[s+8>>2]=4,i[s+12>>2]=-1,n=s+29|0,i[(g=s+16|0)>>2]=0,i[g+4>>2]=0,i[g+8>>2]=0,r[g+12|0]=0,r[n|0]=0|r[p|0],r[n+1|0]=0|r[p+1|0],r[n+2|0]=0|r[p+2|0],n=4,g=9;else{if(0|(n=0|Me(n))){i[(d=s)>>2]=0,i[d+4>>2]=0,i[s+8>>2]=n,i[s+12>>2]=-1,g=s+29|0,i[(d=s+16|0)>>2]=0,i[d+4>>2]=0,i[d+8>>2]=0,r[d+12|0]=0,r[g|0]=0|r[p|0],r[g+1|0]=0|r[p+1|0],r[g+2|0]=0|r[p+2|0],g=9;break}if(!(n=0|tn(1+(0|i[t+8>>2])|0,32))){i[(g=s)>>2]=0,i[g+4>>2]=0,i[s+8>>2]=13,i[s+12>>2]=-1,n=s+29|0,i[(g=s+16|0)>>2]=0,i[g+4>>2]=0,i[g+8>>2]=0,r[g+12|0]=0,r[n|0]=0|r[p|0],r[n+1|0]=0|r[p+1|0],r[n+2|0]=0|r[p+2|0],n=13,g=9;break}Oe(t,n),i[(_=s)>>2]=c,i[_+4>>2]=h,i[(h=s+8|0)>>2]=0,i[s+12>>2]=e,i[s+20>>2]=t,i[s+24>>2]=n,r[s+28|0]=0,r[(c=s+29|0)|0]=0|r[p|0],r[c+1|0]=0|r[p+1|0],r[c+2|0]=0|r[p+2|0],i[s+16>>2]=3,y=+K(n),y*=+W(n),l=+u(+ +A[n>>3]),l=y/+f(+ +dn(+l,+ +u(+ +A[n+8>>3])))*6371.007180918475*6371.007180918475,n=0|i[(c=s+12|0)>>2];t:do{if((0|n)>0)do{if(pe(n+-1|0,d),!(l/+A[d>>3]>10))break t;n=(_=0|i[c>>2])+-1|0,i[c>>2]=n}while((0|_)>1)}while(0);if(Ne(s),i[(c=o)>>2]=0,i[c+4>>2]=0,!(!(0|(n=0|i[(c=s)>>2]))&!(0|(c=0|i[c+4>>2]))))do{Yt(n,c,e,d),p=d,p=0|en(0|i[(t=o)>>2],0|i[t+4>>2],0|i[p>>2],0|i[p+4>>2]),t=0|I(),i[(_=o)>>2]=p,i[_+4>>2]=t,Ne(s),n=0|i[(_=s)>>2],c=0|i[_+4>>2]}while(!(!(0|n)&!(0|c)));n=0|i[h>>2]}}while(0);return M=a,0|(_=n)},_memcpy:yn,_memset:_n,_originToDirectedEdges:function(t,e,n){n|=0;var r,A=0;return r=!(0|jt(t|=0,e|=0)),e&=-2130706433,i[(A=n)>>2]=r?t:0,i[A+4>>2]=r?285212672|e:0,i[(A=n+8|0)>>2]=t,i[A+4>>2]=301989888|e,i[(A=n+16|0)>>2]=t,i[A+4>>2]=318767104|e,i[(A=n+24|0)>>2]=t,i[A+4>>2]=335544320|e,i[(A=n+32|0)>>2]=t,i[A+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){t|=0,e|=0,r|=0;var A,o,s,a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,b=0,w=0,E=0,C=0,x=0,S=0,N=0,D=0,L=0,T=0,O=0,P=0,B=0,F=0,G=0;if(a=M,M=M+112|0,A=a+80|0,h=a+72|0,o=a,s=a+56|0,0|(u=0|Me(n|=0)))return M=a,0|(G=u);if(!(G=0|Je(32+(i[(p=t+8|0)>>2]<<5)|0)))return M=a,0|(G=13);if(Oe(t,G),!(u=0|Me(n))){if(F=0|i[(B=t)+4>>2],i[(u=h)>>2]=i[B>>2],i[u+4>>2]=F,Te(h,A),u=0|nt(A,e,o))B=0,F=0;else{if(u=0|i[h>>2],(0|(c=0|i[p>>2]))>0){l=0|i[t+12>>2],n=0;do{u=(0|i[l+(n<<3)>>2])+u|0,n=n+1|0}while((0|n)!=(0|c));n=u}else n=u;c=0|i[(u=o)>>2],(0|(u=0|i[u+4>>2]))<(0|(l=((0|n)<0)<<31>>31))|(0|u)==(0|l)&c>>>0<n>>>0?(i[(u=o)>>2]=n,i[u+4>>2]=l,u=l):n=c,B=0|en(0|n,0|u,12,0),F=0|I(),i[(u=o)>>2]=B,i[u+4>>2]=F,u=0}if(!u){if(!(n=0|tn(B,8)))return Ze(G),M=a,0|(G=13);if(!(f=0|tn(B,8)))return Ze(G),Ze(n),M=a,0|(G=13);i[(O=A)>>2]=0,i[O+4>>2]=0,P=0|i[(O=t)+4>>2],i[(u=h)>>2]=i[O>>2],i[u+4>>2]=P,u=0|Q(h,B,F,e,A,n,f);t:do{if(u)Ze(n),Ze(f),Ze(G);else{e:do{if((0|i[p>>2])>0){for(l=t+12|0,c=0;u=0|Q((0|i[l>>2])+(c<<3)|0,B,F,e,A,n,f),c=c+1|0,!(0|u);)if((0|c)>=(0|i[p>>2]))break e;Ze(n),Ze(f),Ze(G);break t}}while(0);(0|F)>0|!(0|F)&B>>>0>0&&_n(0|f,0,B<<3),O=0|i[(P=A)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|i[P>>2])>>>0>0){D=n,L=f,T=n,O=f,P=n,u=n,x=n,S=f,N=f,n=f;n:for(;;){for(b=0,w=0,E=0,C=0,c=0,l=0;;){h=(f=o)+56|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|h));if(0|R(p=0|i[(e=D+(b<<3)|0)>>2],e=0|i[e+4>>2],1,o,0)){h=(f=o)+56|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|h));0|(f=0|tn(7,4))&&(k(p,e,1,o,f,7,0,0),Ze(f))}for(v=0;;){_=0|i[(m=o+(v<<3)|0)>>2],m=0|i[m+4>>2];r:do{if(!(0|_)&!(0|m))f=c,h=l;else{if(d=0|un(0|_,0|m,0|B,0|F),p=0|I(),!(!(0|(h=0|i[(e=f=r+(d<<3)|0)>>2]))&!(0|(e=0|i[e+4>>2])))){g=0,y=0;do{if((0|g)>(0|F)|(0|g)==(0|F)&y>>>0>B>>>0)break n;if((0|h)==(0|_)&(0|e)==(0|m)){f=c,h=l;break r}d=0|an(0|(f=0|en(0|d,0|p,1,0)),0|I(),0|B,0|F),p=0|I(),y=0|en(0|y,0|g,1,0),g=0|I(),h=0|i[(e=f=r+(d<<3)|0)>>2],e=0|i[e+4>>2]}while(!(!(0|h)&!(0|e)))}if(!(0|_)&!(0|m)){f=c,h=l;break}ie(_,m,s),0|Pe(t,G,s)&&(y=0|en(0|c,0|l,1,0),l=0|I(),i[(g=f)>>2]=_,i[g+4>>2]=m,i[(c=L+(c<<3)|0)>>2]=_,i[c+4>>2]=m,c=y),f=c,h=l}}while(0);if((v=v+1|0)>>>0>=7)break;c=f,l=h}if(b=0|en(0|b,0|w,1,0),w=0|I(),E=0|en(0|E,0|C,1,0),C=0|I(),c=0|i[(l=A)>>2],!((0|C)<(0|(l=0|i[l+4>>2]))|(0|C)==(0|l)&E>>>0<c>>>0))break;c=f,l=h}if((0|l)>0|!(0|l)&c>>>0>0){c=0,l=0;do{i[(C=D+(c<<3)|0)>>2]=0,i[C+4>>2]=0,c=0|en(0|c,0|l,1,0),l=0|I(),E=0|i[(C=A)+4>>2]}while((0|l)<(0|E)|((0|l)==(0|E)?c>>>0<(0|i[C>>2])>>>0:0))}if(i[(C=A)>>2]=f,i[C+4>>2]=h,!((0|h)>0|!(0|h)&f>>>0>0))break e;v=n,b=N,w=P,E=S,C=L,n=x,N=u,S=T,x=v,u=b,P=O,O=w,T=E,L=D,D=C}Ze(T),Ze(O),Ze(G),u=1;break t}u=f}while(0);Ze(G),Ze(n),Ze(u),u=0}}while(0);return M=a,0|(G=u)}}return Ze(G),M=a,0|(G=u)},_polygonToCellsExperimental:function(t,e,n,r,A,o){r|=0,A|=0,o|=0;var s,a,u,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0;u=M,M=M+160|0,l=u+64|0,p=u+112|0,y=u,Se(h=u+80|0,t|=0,e|=0,n|=0),se(l,0|i[(f=h)>>2],0|i[f+4>>2],e),s=0|i[(f=l)>>2],f=0|i[f+4>>2],c=0|i[h+8>>2],i[(d=p+4|0)>>2]=i[h>>2],i[d+4>>2]=i[h+4>>2],i[d+8>>2]=i[h+8>>2],i[d+12>>2]=i[h+12>>2],i[d+16>>2]=i[h+16>>2],i[d+20>>2]=i[h+20>>2],i[d+24>>2]=i[h+24>>2],i[d+28>>2]=i[h+28>>2],i[(d=y)>>2]=s,i[d+4>>2]=f,i[(d=y+8|0)>>2]=c,e=p,n=(t=y+12|0)+36|0;do{i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}while((0|t)<(0|n));if(i[(p=y+48|0)>>2]=i[l>>2],i[p+4>>2]=i[l+4>>2],i[p+8>>2]=i[l+8>>2],i[p+12>>2]=i[l+12>>2],!(0|s)&!(0|f))return M=u,0|(y=c);n=y+16|0,a=y+24|0,h=y+28|0,c=0,l=0,e=s,t=f;do{if(!((0|c)<(0|A)|(0|c)==(0|A)&l>>>0<r>>>0)){g=4;break}if(f=l,l=0|en(0|l,0|c,1,0),c=0|I(),i[(f=o+(f<<3)|0)>>2]=e,i[f+4>>2]=t,ue(p),!(0|(e=0|i[(t=p)>>2]))&!(0|(t=0|i[t+4>>2]))){if(Ne(n),!(0|(t=0|i[(e=n)>>2]))&!(0|(e=0|i[e+4>>2]))){g=10;break}ae(t,e,0|i[h>>2],p),e=0|i[(t=p)>>2],t=0|i[t+4>>2]}i[(f=y)>>2]=e,i[f+4>>2]=t}while(!(!(0|e)&!(0|t)));return 4==(0|g)?(0|(e=0|i[(t=y+40|0)>>2])&&Ze(e),i[(g=y+16|0)>>2]=0,i[g+4>>2]=0,i[a>>2]=0,i[y+36>>2]=0,i[h>>2]=-1,i[y+32>>2]=0,i[t>>2]=0,ae(0,0,0,p),i[y>>2]=0,i[y+4>>2]=0,i[d>>2]=0,M=u,0|(y=14)):(10==(0|g)&&(i[y>>2]=0,i[y+4>>2]=0,i[d>>2]=i[a>>2]),y=0|i[d>>2],M=u,0|y)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|i[(t|=0)>>2])>>>0)+4294967296*+(0|i[t+4>>2]))},_res0CellCount:function(){return 122},_round:mn,_sbrk:vn,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,A,o,s){t|=0,r|=0,A|=0,o|=0;var a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(a=M,M=M+16|0,g=a,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return M=a,0|(g=0);if((0|(s|=0))>=16)return M=a,0|(g=12);p=0,d=0,h=0,u=0;t:for(;;){if(f=0|ln(0|(c=0|i[(l=t+(p<<3)|0)>>2]),0|(l=0|i[l+4>>2]),52),I(),(15&f)>(0|s)){u=12,c=11;break}if(se(g,c,l,s),!(0|(l=0|i[(f=g)>>2]))&!(0|(f=0|i[f+4>>2])))c=h;else{c=h;do{if(!((0|u)<(0|o)|(0|u)==(0|o)&c>>>0<A>>>0)){c=10;break t}i[(h=r+(c<<3)|0)>>2]=l,i[h+4>>2]=f,c=0|en(0|c,0|u,1,0),u=0|I(),ue(g),l=0|i[(h=g)>>2],f=0|i[h+4>>2]}while(!(!(0|l)&!(0|f)))}if(p=0|en(0|p,0|d,1,0),!((0|(d=0|I()))<(0|n)|(0|d)==(0|n)&p>>>0<e>>>0)){u=0,c=11;break}h=c}return 10==(0|c)?(M=a,0|(g=14)):11==(0|c)?(M=a,0|u):0},_uncompactCellsSize:function(t,e,n,r,A){t|=0,e|=0,n|=0,r|=0,A|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0;s=M,M=M+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(f=0,u=0,a=0,h=0;;){if(!(!(0|(c=0|i[(l=t+(f<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2]))||(l=!(0|Yt(c,l,r,o)),u=0|en(0|i[(c=o)>>2],0|i[c+4>>2],0|u,0|a),a=0|I(),l))){a=12;break}if(f=0|en(0|f,0|h,1,0),!((0|(h=0|I()))<(0|n)|(0|h)==(0|n)&f>>>0<e>>>0))break t}return M=s,0|a}u=0,a=0}while(0);return i[A>>2]=u,i[A+4>>2]=a,M=s,0|(A=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,A,o,s,a=0,u=0;return s=M,M=M+192|0,A=s,o=s+168|0,a=0|ln(0|(t|=0),0|(e|=0),56),I(),a&=7,0|(r=0|re(t,u=-2130706433&e|134217728,o))?(M=s,0|(u=r)):(e=0|ln(0|t,0|e,52),I(),e&=15,0|jt(t,u)?Rt(o,e,a,1,A):Gt(o,e,a,1,A),u=A+8|0,i[n>>2]=i[u>>2],i[n+4>>2]=i[u+4>>2],i[n+8>>2]=i[u+8>>2],i[n+12>>2]=i[u+12>>2],M=s,0|(u=0))},establishStackSpace:function(t,e){M=t|=0},stackAlloc:function(t){var e;return e=M,M=(M=M+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){M=t|=0},stackSave:function(){return 0|M}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{b:function(t){a=t},c:function(){return a},d:function(t,e,n,r){rt("Assertion failed: "+v(t)+", at: "+[e?v(e):"unknown filename",n,r?v(r):"unknown function"])},e:function(t){return n.___errno_location&&(g[n.___errno_location()>>2]=t),t},f:z,g:function(t,e,n){p.set(p.subarray(e,e+n),t)},h:function(t){var e=z(),n=16777216,r=2130706432;if(t>r)return!1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?b(2*i,n):Math.min(b((3*i+2147483648)/4,n),r);return!!function(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(h),j(e),w(e),1}catch(t){}}(i)},i:function(t){rt("OOM")},o:28640,p:28624},f);n.___divdi3=Y.___divdi3,n.___muldi3=Y.___muldi3,n.___remdi3=Y.___remdi3,n.___uremdi3=Y.___uremdi3,n._areNeighborCells=Y._areNeighborCells,n._bitshift64Ashr=Y._bitshift64Ashr,n._bitshift64Lshr=Y._bitshift64Lshr,n._bitshift64Shl=Y._bitshift64Shl,n._calloc=Y._calloc,n._cellAreaKm2=Y._cellAreaKm2,n._cellAreaM2=Y._cellAreaM2,n._cellAreaRads2=Y._cellAreaRads2,n._cellToBoundary=Y._cellToBoundary,n._cellToCenterChild=Y._cellToCenterChild,n._cellToChildPos=Y._cellToChildPos,n._cellToChildren=Y._cellToChildren,n._cellToChildrenSize=Y._cellToChildrenSize,n._cellToLatLng=Y._cellToLatLng,n._cellToLocalIj=Y._cellToLocalIj,n._cellToParent=Y._cellToParent,n._cellToVertex=Y._cellToVertex,n._cellToVertexes=Y._cellToVertexes,n._cellsToDirectedEdge=Y._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=Y._cellsToLinkedMultiPolygon,n._childPosToCell=Y._childPosToCell,n._compactCells=Y._compactCells,n._constructCell=Y._constructCell,n._destroyLinkedMultiPolygon=Y._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=Y._directedEdgeToBoundary,n._directedEdgeToCells=Y._directedEdgeToCells,n._edgeLengthKm=Y._edgeLengthKm,n._edgeLengthM=Y._edgeLengthM,n._edgeLengthRads=Y._edgeLengthRads;var j=n._emscripten_replace_memory=Y._emscripten_replace_memory;n._free=Y._free,n._getBaseCellNumber=Y._getBaseCellNumber,n._getDirectedEdgeDestination=Y._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=Y._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=Y._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=Y._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=Y._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=Y._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=Y._getIcosahedronFaces,n._getIndexDigit=Y._getIndexDigit,n._getNumCells=Y._getNumCells,n._getPentagons=Y._getPentagons,n._getRes0Cells=Y._getRes0Cells,n._getResolution=Y._getResolution,n._greatCircleDistanceKm=Y._greatCircleDistanceKm,n._greatCircleDistanceM=Y._greatCircleDistanceM,n._greatCircleDistanceRads=Y._greatCircleDistanceRads,n._gridDisk=Y._gridDisk,n._gridDiskDistances=Y._gridDiskDistances,n._gridDistance=Y._gridDistance,n._gridPathCells=Y._gridPathCells,n._gridPathCellsSize=Y._gridPathCellsSize,n._gridRing=Y._gridRing,n._gridRingUnsafe=Y._gridRingUnsafe,n._i64Add=Y._i64Add,n._i64Subtract=Y._i64Subtract,n._isPentagon=Y._isPentagon,n._isResClassIII=Y._isResClassIII,n._isValidCell=Y._isValidCell,n._isValidDirectedEdge=Y._isValidDirectedEdge,n._isValidIndex=Y._isValidIndex,n._isValidVertex=Y._isValidVertex,n._latLngToCell=Y._latLngToCell,n._llvm_ctlz_i64=Y._llvm_ctlz_i64,n._llvm_maxnum_f64=Y._llvm_maxnum_f64,n._llvm_minnum_f64=Y._llvm_minnum_f64,n._llvm_round_f64=Y._llvm_round_f64,n._localIjToCell=Y._localIjToCell,n._malloc=Y._malloc,n._maxFaceCount=Y._maxFaceCount,n._maxGridDiskSize=Y._maxGridDiskSize,n._maxPolygonToCellsSize=Y._maxPolygonToCellsSize,n._maxPolygonToCellsSizeExperimental=Y._maxPolygonToCellsSizeExperimental,n._memcpy=Y._memcpy,n._memset=Y._memset,n._originToDirectedEdges=Y._originToDirectedEdges,n._pentagonCount=Y._pentagonCount,n._polygonToCells=Y._polygonToCells,n._polygonToCellsExperimental=Y._polygonToCellsExperimental,n._readInt64AsDoubleFromPointer=Y._readInt64AsDoubleFromPointer,n._res0CellCount=Y._res0CellCount,n._round=Y._round,n._sbrk=Y._sbrk,n._sizeOfCellBoundary=Y._sizeOfCellBoundary,n._sizeOfCoordIJ=Y._sizeOfCoordIJ,n._sizeOfGeoLoop=Y._sizeOfGeoLoop,n._sizeOfGeoPolygon=Y._sizeOfGeoPolygon,n._sizeOfH3Index=Y._sizeOfH3Index,n._sizeOfLatLng=Y._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=Y._sizeOfLinkedGeoPolygon,n._uncompactCells=Y._uncompactCells,n._uncompactCellsSize=Y._uncompactCellsSize,n._vertexToLatLng=Y._vertexToLatLng,n.establishStackSpace=Y.establishStackSpace;var H,X,W=n.stackAlloc=Y.stackAlloc,$=n.stackRestore=Y.stackRestore,K=n.stackSave=Y.stackSave;if(n.asm=Y,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every(function(t){return"number"===t});return"string"!==e&&i&&!r?c(t):function(){return l(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":h[t|0]=e;break;case"i16":d[t>>1]=e;break;case"i32":g[t>>2]=e;break;case"i64":F=[e>>>0,(B=e,+T(B)>=1?B>0?(0|P(+O(B/4294967296),4294967295))>>>0:~~+M((B-+(~~B>>>0))/4294967296)>>>0:0)],g[t>>2]=F[0],g[t+4>>2]=F[1];break;case"float":y[t>>2]=e;break;case"double":_[t>>3]=e;break;default:rt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return h[t|0];case"i16":return d[t>>1];case"i32":case"i64":return g[t>>2];case"float":return y[t>>2];case"double":return _[t>>3];default:rt("invalid type for getValue: "+e)}return null},G){Q(G)||(H=G,G=n.locateFile?n.locateFile(H,A):A+H),R++,n.monitorRunDependencies&&n.monitorRunDependencies(R);var J=function(t){t.byteLength&&(t=new Uint8Array(t)),p.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(R--,n.monitorRunDependencies&&n.monitorRunDependencies(R),0==R&&k){var t=k;k=null,t()}}()},Z=function(){i(G,J,function(){throw"could not load memory initializer "+G})},tt=V(G);if(tt)J(tt.buffer);else if(n.memoryInitializerRequest){var et=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=V(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+G),void Z();e=r.buffer}J(e)};n.memoryInitializerRequest.response?setTimeout(et,0):n.memoryInitializerRequest.addEventListener("load",et)}else Z()}function nt(t){function e(){X||(X=!0,u||(C(x),C(S),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)L(n.postRun.shift());C(N)}()))}R>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)D(n.preRun.shift());C(I)}(),R>0||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),e()},1)):e()))}function rt(t){throw n.onAbort&&n.onAbort(t),o(t+=""),s(t),u=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(k=function t(){X||nt(),X||(k=t)},n.run=nt,n.abort=rt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return nt(),t}("object"==typeof e?e:{}),n="number",r={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid",16:"Index argument was not valid",17:"Base cell number was outside of acceptable range",18:"Child indexing digits invalid",19:"Child indexing digits refer to a deleted subsequence"},i={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};function A(t,e,n){var r=n&&"value"in n,i=new Error((t[e]||"Unknown error")+" (code: "+e+(r?", value: "+n.value:"")+")");return i.code=e,i}function o(t,e){return A(r,t,2===arguments.length?{value:e}:{})}function s(t,e){return A(i,t,2===arguments.length?{value:e}:{})}function a(t){if(0!==t)throw o(t)}var u={};[["sizeOfH3Index",n],["sizeOfLatLng",n],["sizeOfCellBoundary",n],["sizeOfGeoLoop",n],["sizeOfGeoPolygon",n],["sizeOfLinkedGeoPolygon",n],["sizeOfCoordIJ",n],["readInt64AsDoubleFromPointer",n],["isValidCell",n,[n,n]],["isValidIndex",n,[n,n]],["latLngToCell",n,[n,n,n,n]],["cellToLatLng",n,[n,n,n]],["cellToBoundary",n,[n,n,n]],["maxGridDiskSize",n,[n,n]],["gridDisk",n,[n,n,n,n]],["gridDiskDistances",n,[n,n,n,n,n]],["gridRing",n,[n,n,n,n]],["gridRingUnsafe",n,[n,n,n,n]],["maxPolygonToCellsSize",n,[n,n,n,n]],["polygonToCells",n,[n,n,n,n]],["maxPolygonToCellsSizeExperimental",n,[n,n,n,n]],["polygonToCellsExperimental",n,[n,n,n,n,n,n]],["cellsToLinkedMultiPolygon",n,[n,n,n]],["destroyLinkedMultiPolygon",null,[n]],["compactCells",n,[n,n,n,n]],["uncompactCells",n,[n,n,n,n,n,n]],["uncompactCellsSize",n,[n,n,n,n,n]],["isPentagon",n,[n,n]],["isResClassIII",n,[n,n]],["getBaseCellNumber",n,[n,n]],["getResolution",n,[n,n]],["getIndexDigit",n,[n,n,n]],["constructCell",n,[n,n,n,n]],["maxFaceCount",n,[n,n,n]],["getIcosahedronFaces",n,[n,n,n]],["cellToParent",n,[n,n,n,n]],["cellToChildren",n,[n,n,n,n]],["cellToCenterChild",n,[n,n,n,n]],["cellToChildrenSize",n,[n,n,n,n]],["cellToChildPos",n,[n,n,n,n]],["childPosToCell",n,[n,n,n,n,n,n]],["areNeighborCells",n,[n,n,n,n,n]],["cellsToDirectedEdge",n,[n,n,n,n,n]],["getDirectedEdgeOrigin",n,[n,n,n]],["getDirectedEdgeDestination",n,[n,n,n]],["isValidDirectedEdge",n,[n,n]],["directedEdgeToCells",n,[n,n,n]],["originToDirectedEdges",n,[n,n,n]],["directedEdgeToBoundary",n,[n,n,n]],["gridDistance",n,[n,n,n,n,n]],["gridPathCells",n,[n,n,n,n,n]],["gridPathCellsSize",n,[n,n,n,n,n]],["cellToLocalIj",n,[n,n,n,n,n,n]],["localIjToCell",n,[n,n,n,n,n]],["getHexagonAreaAvgM2",n,[n,n]],["getHexagonAreaAvgKm2",n,[n,n]],["getHexagonEdgeLengthAvgM",n,[n,n]],["getHexagonEdgeLengthAvgKm",n,[n,n]],["greatCircleDistanceM",n,[n,n]],["greatCircleDistanceKm",n,[n,n]],["greatCircleDistanceRads",n,[n,n]],["cellAreaM2",n,[n,n,n]],["cellAreaKm2",n,[n,n,n]],["cellAreaRads2",n,[n,n,n]],["edgeLengthM",n,[n,n,n]],["edgeLengthKm",n,[n,n,n]],["edgeLengthRads",n,[n,n,n]],["getNumCells",n,[n,n]],["getRes0Cells",n,[n]],["res0CellCount",n],["getPentagons",n,[n,n]],["pentagonCount",n],["cellToVertex",n,[n,n,n,n]],["cellToVertexes",n,[n,n,n]],["vertexToLatLng",n,[n,n,n]],["isValidVertex",n,[n,n]]].forEach(function(t){u[t[0]]=e.cwrap.apply(e,t)});var c=16,l=u.sizeOfH3Index(),f=u.sizeOfLatLng(),h=u.sizeOfCellBoundary(),p=u.sizeOfGeoPolygon(),d=u.sizeOfGeoLoop();function g(t){if(!t)throw s(1002);return t}u.sizeOfLinkedGeoPolygon(),u.sizeOfCoordIJ();var y=Math.pow(2,32)-1;var _=/[^0-9a-fA-F]/;function m(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||_.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),c);return[parseInt(t.substring(t.length-8),c),e]}function v(t){if(t>=0)return t.toString(c);var e=b(8,(t&=2147483647).toString(c));return e=(parseInt(e[0],c)+8).toString(c)+e.substring(1)}function b(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}var w=Math.pow(2,32);function E(t,n,r){for(var i=t.length,A=e._calloc(i,f),o=r?1:0,s=r?0:1,a=0;a<2*i;a+=2)e.HEAPF64.set([t[a/2][o],t[a/2][s]].map(M),A/8+a);return e.HEAPU32.set([i,A],n/4),n}function C(t,n){void 0===n&&(n=0);var r=e.getValue(t+l*n,"i32"),i=e.getValue(t+l*n+4,"i32");return i?function(t,e){return v(e)+b(8,v(t))}(r,i):null}function I(t){return function(t){return 180*t/Math.PI}(e.getValue(t,"double"))}function x(t){return[I(t+8),I(t)]}function S(t,n,r){var i=e._malloc(f);e.HEAPF64.set([t,n].map(M),i/8);var A=e._malloc(l);try{return a(u.latLngToCell(i,r,A)),g(C(A))}finally{e._free(A),e._free(i)}}function N(t,n){var r=e._malloc(h),i=m(t),A=i[0],o=i[1];try{return a(u.cellToBoundary(A,o,r)),function(t){for(var n=e.getValue(t,"i32"),r=t+8,i=[],A=x,o=0;o<2*n;o+=2)i.push(A(r+8*o));return i.push(i[0]),i}(r)}finally{e._free(r)}}function D(t,n){var r=m(t),i=r[0],A=r[1],o=e._malloc(l);try{return a(u.cellToParent(i,A,n,o)),g(C(o))}finally{e._free(o)}}function L(t,n,r){var i,A="number"!=typeof(i=t)?[0,0]:[0|i,i/w|0],o=A[0],s=A[1],c=m(n),f=c[0],h=c[1],p=e._malloc(l);try{return a(u.childPosToCell(o,s,f,h,r,p)),g(C(p))}finally{e._free(p)}}function T(t,n,r){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw o(4,t)}(n),r=Boolean(r),0===t.length||0===t[0].length)return[];var i,A=function(t,n){var r,i=t.length-1,A=e._calloc(p),o=0+d,s=o+4;if(E(t[0],A+0,n),i>0){r=e._calloc(i,d);for(var a=0;a<i;a++)E(t[a+1],r+d*a,n)}return e.setValue(A+o,i,"i32"),e.setValue(A+s,r,"i32"),A}("number"==typeof t[0][0]?[t]:t,r),c=e._malloc(8);try{a(u.maxPolygonToCellsSize(A,n,0,c));var f=function(t){if(t>y)throw s(1001,t);return t}((i=c,u.readInt64AsDoubleFromPointer(i))),h=e._calloc(f,l);try{return a(u.polygonToCells(A,n,0,h)),function(t,e){for(var n=[],r=0;r<e;r++){var i=C(t,r);null!==i&&n.push(i)}return n}(h,f)}finally{e._free(h)}}finally{e._free(c),function(t){var n=0+d,r=n+4;e._free(e.getValue(t+0+4,"i8*"));var i=e.getValue(t+n,"i32");if(i>0){for(var A=e.getValue(t+r,"i32"),o=0;o<i;o++)e._free(e.getValue(A+d*o+4,"i8*"));e._free(A)}e._free(t)}(A)}}function M(t){return t*Math.PI/180}const O={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE",CORRIDOR:"CORRIDOR"},P={[O.LARGE]:2,[O.MEDIUM]:4,[O.SMALL]:1/0},R=0,k=52,B={HOURS_AGO:2,SEVERITY:0,ALT_FROM:R,ALT_TO:k},F={[O.SMALL]:1,[O.MEDIUM]:0,[O.LARGE]:0,[O.CORRIDOR]:1},G={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},U={DATA:"/observations/v5/hexagons/{resolution}/{hexId}"},Q={[O.SMALL]:0,[O.MEDIUM]:1,[O.LARGE]:1,[O.CORRIDOR]:1},z={[O.SMALL]:2,[O.MEDIUM]:1,[O.LARGE]:2.5,[O.CORRIDOR]:1},q="polygon",V="isCorridorMode",Y="aircraftCategory",j=(t={icao:"",mapping:[]})=>{const{icao:e,mapping:n}=t;if(!e||!n||0===n.length)return G.C60;const r=n.find(t=>t.icao.toUpperCase()===e.toUpperCase())?.group;return r||G.C60},H=({value:t})=>void 0===t,X=({fn:t})=>"function"==typeof t,W=({value:t})=>"object"==typeof t,$=({time:t})=>{let e;const n=()=>{clearTimeout(e),e=null};return{run:r=>{n(),e=setTimeout(r,t)},cancel:n}},K=({current:t,next:e})=>{if(H({value:e}))return!1;const n=W({value:e}),r=Array.isArray(e);return n&&!r?Object.keys(e).some(n=>K({current:t?.[n],next:e[n]})):r?e.some((e,n)=>K({current:t?.[n],next:e})):t!==e},J=({current:t,next:e})=>Object.keys(e).reduce((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t),{...t}),Z=({current:t,next:e})=>{const n=new Set,r=!H({value:t})&&W({value:t});if(!(!H({value:e})&&W({value:e})))return n;const i=Object.keys(e);return r?(i.forEach(r=>{K({current:t[r],next:e[r]})&&n.add(r)}),n):(i.forEach(t=>n.add(t)),n)},tt=({edrValue:t})=>null==t||isNaN(t)||t<=.13?0:t<=.18?1:t<=.25?2:t<=.4?3:4;var et=Object.freeze({__proto__:null,buildDataKeyFromComponents:({components:t,separator:e="-"})=>t.join(e),debounce:({fn:t,delay:e})=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}},getChangedFields:Z,getSeverityValueByEdrValue:tt,getTimer:$,isChanged:K,isFunction:X,isObject:W,isUndefined:H,mapAircraftIcaoToAircraftType:j,mergeByProperty:({target:t,source:e,propName:n})=>{const r=[...t];return e.forEach(t=>{let e=r.find(e=>t[n]===e[n]);e?Object.assign(e,t):r.push(t)}),r},mergeWithoutUndefined:J,parseDataKeyToComponents:({dataKey:t,separator:e="-"})=>t.split(e),throttle:({fn:t,delay:e})=>{let n=0;return(...r)=>{const i=(new Date).getTime();i-n<e||(n=i,t(...r))}}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rt={exports:{}};rt.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",A="minute",o="hour",s="day",a="week",u="month",c="quarter",l="year",f="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},_={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),A=n-i<0,o=e.clone().add(r+(A?-1:1),u);return+(-(r+(n-i)/(A?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:l,w:a,d:s,D:f,h:o,m:A,s:i,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=g;var b="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[b])},E=function t(e,n,r){var i;if(!e)return m;if("string"==typeof e){var A=e.toLowerCase();v[A]&&(i=A),n&&(v[A]=n,i=A);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var s=e.name;v[s]=e,i=s}return!r&&i&&(m=i),i||!r&&m},C=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},I=_;I.l=E,I.i=w,I.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=E(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(I.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,A=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,A)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,A)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return I},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(t,e){var n=C(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return C(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<C(t)},y.$g=function(t,e,n){return I.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!I.u(e)||e,c=I.p(t),h=function(t,e){var i=I.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(s)},p=function(t,e){return I.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},d=this.$W,g=this.$M,y=this.$D,_="set"+(this.$u?"UTC":"");switch(c){case l:return r?h(1,0):h(31,11);case u:return r?h(1,g):h(0,g+1);case a:var m=this.$locale().weekStart||0,v=(d<m?d+7:d)-m;return h(r?y-v:y+(6-v),g);case s:case f:return p(_+"Hours",0);case o:return p(_+"Minutes",1);case A:return p(_+"Seconds",2);case i:return p(_+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,a=I.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[l]=c+"FullYear",n[o]=c+"Hours",n[A]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[a],p=a===s?this.$D+(e-this.$W):e;if(a===u||a===l){var d=this.clone().set(f,1);d.$d[h](p),d.init(),this.$d=d.set(f,Math.min(this.$D,d.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[I.p(t)]()},y.add=function(r,c){var f,h=this;r=Number(r);var p=I.p(c),d=function(t){var e=C(h);return I.w(e.date(e.date()+Math.round(t*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===l)return this.set(l,this.$y+r);if(p===s)return d(1);if(p===a)return d(7);var g=(f={},f[A]=e,f[o]=n,f[i]=t,f)[p]||1,y=this.$d.getTime()+r*g;return I.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=I.z(this),A=this.$H,o=this.$m,s=this.$M,a=n.weekdays,u=n.months,c=n.meridiem,l=function(t,n,i,A){return t&&(t[n]||t(e,r))||i[n].slice(0,A)},f=function(t){return I.s(A%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(d,function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return I.s(e.$y,4,"0");case"M":return s+1;case"MM":return I.s(s+1,2,"0");case"MMM":return l(n.monthsShort,s,u,3);case"MMMM":return l(u,s);case"D":return e.$D;case"DD":return I.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(n.weekdaysMin,e.$W,a,2);case"ddd":return l(n.weekdaysShort,e.$W,a,3);case"dddd":return a[e.$W];case"H":return String(A);case"HH":return I.s(A,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(A,o,!0);case"A":return p(A,o,!1);case"m":return String(o);case"mm":return I.s(o,2,"0");case"s":return String(e.$s);case"ss":return I.s(e.$s,2,"0");case"SSS":return I.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,f,h){var p,d=this,g=I.p(f),y=C(r),_=(y.utcOffset()-this.utcOffset())*e,m=this-y,v=function(){return I.m(d,y)};switch(g){case l:p=v()/12;break;case u:p=v();break;case c:p=v()/3;break;case a:p=(m-_)/6048e5;break;case s:p=(m-_)/864e5;break;case o:p=m/n;break;case A:p=m/e;break;case i:p=m/t;break;default:p=m}return h?p:I.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return v[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=E(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return I.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),S=x.prototype;return C.prototype=S,[["$ms",r],["$s",i],["$m",A],["$H",o],["$W",s],["$M",u],["$y",l],["$D",f]].forEach(function(t){S[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),C.extend=function(t,e){return t.$i||(t(e,x,C),t.$i=!0),C},C.locale=E,C.isDayjs=w,C.unix=function(t){return C(1e3*t)},C.en=v[m],C.Ls=v,C.p={},C}();var it=nt(rt.exports),At=6371008.8,ot={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*At,kilometers:6371.0088,kilometres:6371.0088,meters:At,metres:At,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:At/1852,radians:1,yards:6967335.223679999};function st(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function at(t,e,n){if(void 0===n&&(n={}),!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(!dt(t[0])||!dt(t[1]))throw new Error("coordinates must contain numbers");return st({type:"Point",coordinates:t},e,n)}function ut(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var A=i[r];if(A.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<A[A.length-1].length;o++)if(A[A.length-1][o]!==A[0][o])throw new Error("First and last Position are not equivalent.")}return st({type:"Polygon",coordinates:t},e,n)}function ct(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function lt(t,e){void 0===e&&(e="kilometers");var n=ot[e];if(!n)throw new Error(e+" units is invalid");return t*n}function ft(t,e){void 0===e&&(e="kilometers");var n=ot[e];if(!n)throw new Error(e+" units is invalid");return t/n}function ht(t){return t%360*Math.PI/180}function pt(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return lt(ft(t,e),n)}function dt(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function gt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return yt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return yt(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return mt(t);default:throw new Error("unknown GeoJSON type")}}function yt(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=_t(t.properties),e.geometry=mt(t.geometry),e}function _t(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map(function(t){return t}):e[n]=_t(r):e[n]=r}),e):e}function mt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return mt(t)}),e):(e.coordinates=vt(t.coordinates),e)}function vt(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map(function(t){return vt(t)})}function bt(t,e,n){if(null!==t)for(var r,i,A,o,s,a,u,c,l=0,f=0,h=t.type,p="FeatureCollection"===h,d="Feature"===h,g=p?t.features.length:1,y=0;y<g;y++){s=(c=!!(u=p?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var _=0;_<s;_++){var m=0,v=0;if(null!==(o=c?u.geometries[_]:u)){a=o.coordinates;var b=o.type;switch(l=!n||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===e(a,f,y,m,v))return!1;f++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<a.length;r++){if(!1===e(a[r],f,y,m,v))return!1;f++,"MultiPoint"===b&&m++}"LineString"===b&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<a.length;r++){for(i=0;i<a[r].length-l;i++){if(!1===e(a[r][i],f,y,m,v))return!1;f++}"MultiLineString"===b&&m++,"Polygon"===b&&v++}"Polygon"===b&&m++;break;case"MultiPolygon":for(r=0;r<a.length;r++){for(v=0,i=0;i<a[r].length;i++){for(A=0;A<a[r][i].length-l;A++){if(!1===e(a[r][i][A],f,y,m,v))return!1;f++}v++}m++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===bt(o.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function wt(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Et(t,e){var n,r,i,A,o,s,a,u,c,l,f=0,h="FeatureCollection"===t.type,p="Feature"===t.type,d=h?t.features.length:1;for(n=0;n<d;n++){for(s=h?t.features[n].geometry:p?t.geometry:t,u=h?t.features[n].properties:p?t.properties:{},c=h?t.features[n].bbox:p?t.bbox:void 0,l=h?t.features[n].id:p?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(A=a?s.geometries[i]:s))switch(A.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(A,f,u,c,l))return!1;break;case"GeometryCollection":for(r=0;r<A.geometries.length;r++)if(!1===e(A.geometries[r],f,u,c,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,u,c,l))return!1;f++}}function Ct(t){var e=[1/0,1/0,-1/0,-1/0];return bt(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}function It(t,e){void 0===e&&(e={});var n=Ct(t);return at([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}function xt(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function St(t,e){var n=ht(t[1]),r=ht(e[1]),i=ht(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var A=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(function(t){return t%(2*Math.PI)*180/Math.PI}(Math.atan2(i,A))+360)%360}function Nt(t,e,n){void 0===n&&(n={});var r=xt(t),i=xt(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var A=function(t,e,n){var r=n=void 0===n?At:Number(n),i=t[1]*Math.PI/180,A=e[1]*Math.PI/180,o=A-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var a=Math.log(Math.tan(A/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),u=Math.abs(a)>1e-11?o/a:Math.cos(i);return Math.sqrt(o*o+u*u*s*s)*r}(r,i);return pt(A,"meters",n.units)}function Dt(t,e,n,r){void 0===r&&(r={});var i=e<0,A=pt(Math.abs(e),r.units,"meters");i&&(A=-Math.abs(A));var o=xt(t),s=function(t,e,n,r){r=void 0===r?At:Number(r);var i=e/r,A=t[0]*Math.PI/180,o=ht(t[1]),s=ht(n),a=i*Math.cos(s),u=o+a;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),l=Math.abs(c)>1e-11?a/c:Math.cos(o),f=i*Math.sin(s)/l;return[(180*(A+f)/Math.PI+540)%360-180,180*u/Math.PI]}(o,A,n);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,at(s,r.properties)}function Lt(t,e,n){if(!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,i=n.origin,A=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(i)||"object"==typeof i;return!0!==A&&(t=gt(t)),"FeatureCollection"!==t.type||o?Tt(t,e,i):(wt(t,function(n,r){t.features[r]=Tt(n,e,i)}),t)}function Tt(t,e,n){var r,i="Point"===("FeatureCollection"===(r=t).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":"Feature"===r.type&&null!==r.geometry?r.geometry.type:r.type);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return xt(e);var n=t.bbox?t.bbox:Ct(t),r=n[0],i=n[1],A=n[2],o=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return at([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return at([A,i]);case"nw":case"northwest":case"westnorth":case"topleft":return at([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return at([A,o]);case"center":return It(t);case void 0:case null:case"centroid":return function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return bt(t,function(t){n+=t[0],r+=t[1],i++},!0),at([n/i,r/i],e.properties)}(t);default:throw new Error("invalid origin")}}(t,n),1===e||i||bt(t,function(t){var r,i,A,o,s=Nt(n,t),a=(r=n,i=t,void 0===A&&(A={}),(o=A.final?St(xt(i),xt(r)):St(xt(r),xt(i)))>180?-(360-o):o),u=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Dt(n,s*e,a));t[0]=u[0],t[1]=u[1],3===t.length&&(t[2]*=e)}),t}Ct.default=Ct;var Mt={exports:{}};(function(t){function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function A(){}function o(t){return null===t?Pt:t.color}function s(t){return null===t?null:t.parent}function a(t,e){null!==t&&(t.color=e)}function u(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function l(){this.root_=null,this.size_=0}function f(){}function h(){this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}function p(){}function d(t){this.message=t||""}function g(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)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 i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},v={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},v.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,v);var b=function(){},w=function(){},E=function(){},C=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},I={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};C.prototype.setOrdinate=function(t,e){switch(t){case C.X:this.x=e;break;case C.Y:this.y=e;break;case C.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},C.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!y.equalsWithTolerance(this.x,e.x,n)&&!!y.equalsWithTolerance(this.y,e.y,n)}},C.prototype.getOrdinate=function(t){switch(t){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.z}throw new _("Invalid ordinate index: "+t)},C.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},C.prototype.equals=function(t){return t instanceof C&&this.equals2D(t)},C.prototype.equalInZ=function(t,e){return y.equalsWithTolerance(this.z,t.z,e)},C.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},C.prototype.clone=function(){},C.prototype.copy=function(){return new C(this)},C.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},C.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)},C.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},C.prototype.hashCode=function(){var t=17;return 37*(t=37*t+C.hashCode(this.x))+C.hashCode(this.y)},C.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},C.prototype.interfaces_=function(){return[b,w,e]},C.prototype.getClass=function(){return C},C.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=m.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},I.DimensionalComparator.get=function(){return x},I.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},I.NULL_ORDINATE.get=function(){return m.NaN},I.X.get=function(){return 0},I.Y.get=function(){return 1},I.Z.get=function(){return 2},Object.defineProperties(C,I);var x=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};x.prototype.compare=function(t,e){var n=t,r=e,i=x.compare(n.x,r.x);if(0!==i)return i;var A=x.compare(n.y,r.y);return 0!==A?A:this._dimensionsToTest<=2?0:x.compare(n.z,r.z)},x.prototype.interfaces_=function(){return[E]},x.prototype.getClass=function(){return x},x.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var S=function(){};S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S};var N=function(){},D={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N},N.toLocationSymbol=function(t){switch(t){case N.EXTERIOR:return"e";case N.BOUNDARY:return"b";case N.INTERIOR:return"i";case N.NONE:return"-"}throw new _("Unknown location value: "+t)},D.INTERIOR.get=function(){return 0},D.BOUNDARY.get=function(){return 1},D.EXTERIOR.get=function(){return 2},D.NONE.get=function(){return-1},Object.defineProperties(N,D);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},T=function(){},M={LOG_10:{configurable:!0}};T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},T.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],A=arguments[2];return r<i?i:r>A?A:r}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],A=arguments[3],o=arguments[0];return r>o&&(o=r),i>o&&(o=i),A>o&&(o=A),o}},T.average=function(t,e){return(t+e)/2},M.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,M);var O=function(t){this.str=t};O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str};var P=function(t){this.value=t};P.prototype.intValue=function(){return this.value},P.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},P.isNaN=function(t){return Number.isNaN(t)};var R=function(){};R.isWhitespace=function(t){return t<=32&&t>=0||127===t},R.toUpperCase=function(t){return t.toUpperCase()};var k=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},B={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}};k.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},k.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=k.magnitude(n._hi),i=k.TEN.pow(r);(n=n.divide(i)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var A=r+1,o=new O,s=k.MAX_PRINT_DIGITS-1,a=0;a<=s;a++){t&&a===A&&o.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,l=0;u>9?(c=!0,l="9"):l="0"+u,o.append(l),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var f=!0,h=k.magnitude(n._hi);if(h<0&&Math.abs(h)>=s-a&&(f=!1),!f)break}return e[0]=r,o.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},k.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},k.prototype.isZero=function(){return 0===this._hi&&0===this._lo},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(t){return this.le(t)?this:t},k.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,A=null,o=null,s=null,a=null,u=null,c=null,l=null;return a=this._hi/n,l=(i=(u=k.SPLIT*a)-(i=u-a))*(o=(l=k.SPLIT*n)-(o=l-n))-(c=a*n)+i*(s=n-o)+(A=a-i)*o+A*s,l=a+(u=(this._hi-c-l+this._lo-a*r)/n),this._hi=l,this._lo=a-l+u,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var t=arguments[0],e=null,n=null,r=null,i=null,A=null,o=null,s=null,a=null;return n=(A=this._hi/t._hi)-(e=(o=k.SPLIT*A)-(e=o-A)),a=e*(r=(a=k.SPLIT*t._hi)-(r=a-t._hi))-(s=A*t._hi)+e*(i=t._hi-r)+n*r+n*i,o=(this._hi-s-a+this._lo-A*t._lo)/t._hi,new k(a=A+o,A-a+o)}if("number"==typeof arguments[0]){var u=arguments[0];return m.isNaN(u)?k.createNaN():k.copy(this).selfDivide(u,0)}},k.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},k.prototype.pow=function(t){if(0===t)return k.valueOf(1);var e=new k(this),n=k.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new k(t,e)},k.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},k.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},k.prototype.max=function(t){return this.ge(t)?this:t},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=k.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},k.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,A=null,o=null,s=null;return A=(i=this._hi+e)-(o=i-this._hi),r=(s=(A=e-o+(this._hi-A))+this._lo)+(i-(n=i+s)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var a=arguments[0],u=arguments[1],c=null,l=null,f=null,h=null,p=null,d=null,g=null;h=this._hi+a,l=this._lo+u,p=h-(d=h-this._hi),f=l-(g=l-this._lo);var y=(c=h+(d=(p=a-d+(this._hi-p))+l))+(d=(f=u-g+(this._lo-f))+(d+(h-c))),_=d+(c-y);return this._hi=y,this._lo=_,this}},k.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,A=null,o=null,s=null,a=null,u=null;i=(a=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,i=a-i,A=this._hi-i,o=u-n;var c=(a=this._hi*n)+(u=i*(o=u-o)-a+i*(s=n-o)+A*o+A*s+(this._hi*r+this._lo*n)),l=u+(i=a-c);return this._hi=c,this._lo=l,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new k(t,e)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var t=arguments[0];return t.isNaN()?k.createNaN():k.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return m.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var t=k.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var A=r-n.length;i=n+k.stringOfChar("0",A)+".0"}return this.isNegative()?"-"+i:i},k.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,A=null,o=null,s=null;e=(i=1/this._hi)-(t=(A=k.SPLIT*i)-(t=A-i)),n=(s=k.SPLIT*this._hi)-this._hi;var a=i+(A=(1-(o=i*this._hi)-(s=t*(n=s-n)-o+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new k(a,i-a+A)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=k.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var A=n.charAt(0)+"."+i;return this.isNegative()?"-"+A+r:A+r},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},k.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var t=arguments[0];return k.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return k.copy(this).selfAdd(e)}},k.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof k){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},k.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},k.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[e,b,w]},k.prototype.getClass=function(){return k},k.sqr=function(t){return k.valueOf(t).selfMultiply(t)},k.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return k.parse(t)}if("number"==typeof arguments[0])return new k(arguments[0])},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;R.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var A=new k,o=0,s=0,a=0;!(e>=n);){var u=t.charAt(e);if(e++,R.isDigit(u)){var c=u-"0";A.selfMultiply(k.TEN),A.selfAdd(c),o++}else{if("."!==u){if("e"===u||"E"===u){var l=t.substring(e);try{a=P.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}s=o}}var f=A,h=o-s-a;if(0===h)f=A;else if(h>0){var p=k.TEN.pow(h);f=A.divide(p)}else if(h<0){var d=k.TEN.pow(-h);f=A.multiply(d)}return r?f.negate():f},k.createNaN=function(){return new k(m.NaN,m.NaN)},k.copy=function(t){return new k(t)},k.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},k.stringOfChar=function(t,e){for(var n=new O,r=0;r<e;r++)n.append(t);return n.toString()},B.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},B.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},B.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},B.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},B.NaN.get=function(){return new k(m.NaN,m.NaN)},B.EPS.get=function(){return 123259516440783e-46},B.SPLIT.get=function(){return 134217729},B.MAX_PRINT_DIGITS.get=function(){return 32},B.TEN.get=function(){return k.valueOf(10)},B.ONE.get=function(){return k.valueOf(1)},B.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},B.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,B);var F=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.orientationIndex=function(t,e,n){var r=F.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=k.valueOf(e.x).selfAdd(-t.x),A=k.valueOf(e.y).selfAdd(-t.y),o=k.valueOf(n.x).selfAdd(-e.x),s=k.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(s).selfSubtract(A.selfMultiply(o)).signum()},F.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},F.intersection=function(t,e,n,r){var i=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),A=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),o=i.subtract(A),s=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),a=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(a).selfDivide(o).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),l=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),f=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(f).selfDivide(o).doubleValue(),p=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(h)).doubleValue();return new C(c,p)},F.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),A=(t.y-n.y)*(e.x-n.x),o=i-A;if(i>0){if(A<=0)return F.signum(o);r=i+A}else{if(!(i<0))return F.signum(o);if(A>=0)return F.signum(o);r=-i-A}var s=F.DP_SAFE_EPSILON*r;return o>=s||-o>=s?F.signum(o):2},F.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,G);var U=function(){},Q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Q.X.get=function(){return 0},Q.Y.get=function(){return 1},Q.Z.get=function(){return 2},Q.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,n){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[w]},U.prototype.getClass=function(){return U},Object.defineProperties(U,Q);var z=function(){},q=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(z),V=function(){};V.arraycopy=function(t,e,n,r,i){for(var A=0,o=e;o<e+i;o++)n[r+A]=t[o],A++},V.getProperty=function(t){return{"line.separator":"\n"}[t]};var Y=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],A=arguments[1];this.x=i.y*A.w-A.y*i.w,this.y=A.x*i.w-i.x*A.w,this.w=i.x*A.y-A.x*i.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2];this.x=a,this.y=u,this.w=c}else if(4===arguments.length){var l=arguments[0],f=arguments[1],h=arguments[2],p=arguments[3],d=l.y-f.y,g=f.x-l.x,y=l.x*f.y-f.x*l.y,_=h.y-p.y,m=p.x-h.x,v=h.x*p.y-p.x*h.y;this.x=g*v-m*y,this.y=_*y-d*v,this.w=d*m-_*g}};Y.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new q;return t},Y.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new q;return t},Y.prototype.getCoordinate=function(){var t=new C;return t.x=this.getX(),t.y=this.getY(),t},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.intersection=function(t,e,n,r){var i=t.y-e.y,A=e.x-t.x,o=t.x*e.y-e.x*t.y,s=n.y-r.y,a=r.x-n.x,u=n.x*r.y-r.x*n.y,c=i*a-s*A,l=(A*u-a*o)/c,f=(s*o-i*u)/c;if(m.isNaN(l)||m.isInfinite(l)||m.isNaN(f)||m.isInfinite(f))throw new q;return new C(l,f)};var j=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(A,o,s,a)}},H={serialVersionUID:{configurable:!0}};j.prototype.getArea=function(){return this.getWidth()*this.getHeight()},j.prototype.equals=function(t){if(!(t instanceof j))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()},j.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new j;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,i=this._maxy<t._maxy?this._maxy:t._maxy;return new j(e,r,n,i)},j.prototype.isNull=function(){return this._maxx<this._minx},j.prototype.getMaxX=function(){return this._maxx},j.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof j){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},j.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof C){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},j.prototype.getMinY=function(){return this._miny},j.prototype.getMinX=function(){return this._minx},j.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof j){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(2===arguments.length){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))}},j.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},j.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},j.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},j.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},j.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},j.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},j.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},j.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},j.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){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()}},j.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},j.prototype.centre=function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},j.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3];i<A?(this._minx=i,this._maxx=A):(this._minx=A,this._maxx=i),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},j.prototype.getMaxY=function(){return this._maxy},j.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),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},j.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)},j.prototype.interfaces_=function(){return[b,e]},j.prototype.getClass=function(){return j},j.intersects=function(){if(3===arguments.length){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)}if(4===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2],o=arguments[3],s=Math.min(A.x,o.x),a=Math.max(A.x,o.x),u=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(u>a||c<s||(s=Math.min(A.y,o.y),a=Math.max(A.y,o.y),u=Math.min(r.y,i.y),c=Math.max(r.y,i.y),u>a||c<s))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(j,H);var X={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*$/},W=function(t){this.geometryFactory=t||new ye};W.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=X.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=X.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},W.prototype.write=function(t){return this.extractGeometry(t)},W.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!$[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+$[e].apply(this,[t])+")"};var $={coordinate:function(t){return t.x+" "+t.y},point:function(t){return $.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push($.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push($.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+$.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+$.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(X.spaces);return this.geometryFactory.createPoint(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,A=n.length;i<A;++i)e=n[i].replace(X.trimParens,"$1"),r.push(K.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,A=n.length;i<A;++i)e=n[i].trim().split(X.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,A=n.length;i<A;++i)e=n[i].trim().split(X.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(X.parenComma),r=[],i=0,A=n.length;i<A;++i)e=n[i].replace(X.trimParens,"$1"),r.push(K.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,A=t.trim().split(X.parenComma),o=[],s=0,a=A.length;s<a;++s)e=A[s].replace(X.trimParens,"$1"),n=K.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?i=r:o.push(r);return this.geometryFactory.createPolygon(i,o)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(X.doubleParenComma),r=[],i=0,A=n.length;i<A;++i)e=n[i].replace(X.trimParens,"$1"),r.push(K.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},J=function(t){this.parser=new W(t)};J.prototype.write=function(t){return this.parser.write(t)},J.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Z=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Z),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=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 C,this._intPt[1]=new C,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.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)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return J.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+J.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),A=-1;if(t.equals(e))A=0;else if(t.equals(n))A=r>i?r:i;else{var o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(A=r>i?o:s)||t.equals(e)||(A=Math.max(o,s))}return et.isTrue(!(0===A&&!t.equals(e)),"Bad distance calculation"),A},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,A=Math.sqrt(r*r+i*i);return et.isTrue(!(0===A&&!t.equals(e)),"Invalid distance calculation"),A},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new j(this._inputLines[0][0],this._inputLines[0][1]),n=new j(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,j.intersects(n,r,e)&&0===st.orientationIndex(n,r,e)&&0===st.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var A=null;try{A=Y.intersection(t,n,r,i)}catch(o){if(!(o instanceof q))throw o;A=e.nearestEndpoint(t,n,r,i)}return A},e.prototype.intersection=function(t,n,r,i){var A=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(A)||(A=new C(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(A),A},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,A=Math.abs(i);return Math.abs(e)<A&&(i=e,A=Math.abs(e)),Math.abs(n)<A&&(i=n,A=Math.abs(n)),Math.abs(r)<A&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var A=F.intersection(t,e,n,r),o=this.isInSegmentEnvelopes(A);V.out.println("DD in env = "+o+" --------------------- "+A),i.distance(A)>1e-4&&V.out.println("Distance = "+i.distance(A))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new C(t),A=new C(e),o=new C(n),s=new C(r),a=new C;this.normalizeToEnvCentre(i,A,o,s,a);var u=this.safeHCoordinateIntersection(i,A,o,s);return u.x+=a.x,u.y+=a.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,i){var A=j.intersects(e,n,r),o=j.intersects(e,n,i),s=j.intersects(r,i,e),a=j.intersects(r,i,n);return A&&o?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):A&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):A&&a?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||A||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||A||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var A=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,f=n.y>r.y?n.y:r.y,h=((A>u?A:u)+(s<l?s:l))/2,p=((o>c?o:c)+(a<f?a:f))/2;i.x=h,i.y=p,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!j.intersects(e,n,r,i))return t.NO_INTERSECTION;var A=st.orientationIndex(e,n,r),o=st.orientationIndex(e,n,i);if(A>0&&o>0||A<0&&o<0)return t.NO_INTERSECTION;var s=st.orientationIndex(r,i,e),a=st.orientationIndex(r,i,n);return s>0&&a>0||s<0&&a<0?t.NO_INTERSECTION:0===A&&0===o&&0===s&&0===a?this.computeCollinearIntersection(e,n,r,i):(0===A||0===o||0===s||0===a?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===A?this._intPt[0]=new C(r):0===o?this._intPt[0]=new C(i):0===s?this._intPt[0]=new C(e):0===a&&(this._intPt[0]=new C(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,A=st.distancePointLine(t,n,r),o=st.distancePointLine(e,n,r);return o<A&&(A=o,i=e),(o=st.distancePointLine(n,t,e))<A&&(A=o,i=n),(o=st.distancePointLine(r,t,e))<A&&(A=o,i=r),i},e}(nt),At=function(){};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,A=n.x-e.x,o=n.y-e.y;return At.signOfDet2x2(r,i,A,o)},At.signOfDet2x2=function(t,e,n,r){var i=null,A=null,o=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,A=t,t=n,n=A,A=e,e=r,r=A):e<=-r?(i=-i,n=-n,r=-r):(A=t,t=-n,n=A,A=e,e=-r,r=A):r>0?-e<=r?(i=-i,t=-t,e=-e):(A=-t,t=n,n=A,A=-e,e=r,r=A):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,A=-t,t=-n,n=A,A=-e,e=-r,r=A),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(o=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=o*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(o=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=o*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var ot=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ot.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 i=t.x-this._p.x,A=t.y-this._p.y,o=e.x-this._p.x,s=e.y-this._p.y,a=At.signOfDet2x2(i,A,o,s);if(0===a)return this._isPointOnSegment=!0,null;s<A&&(a=-a),a>0&&this._crossingCount++}},ot.prototype.isPointInPolygon=function(){return this.getLocation()!==N.EXTERIOR},ot.prototype.getLocation=function(){return this._isPointOnSegment?N.BOUNDARY:this._crossingCount%2==1?N.INTERIOR:N.EXTERIOR},ot.prototype.isOnSegment=function(){return this._isPointOnSegment},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.locatePointInRing=function(){if(arguments[0]instanceof C&&L(arguments[1],U)){for(var t=arguments[1],e=new ot(arguments[0]),n=new C,r=new C,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var A=arguments[1],o=new ot(arguments[0]),s=1;s<A.length;s++){var a=A[s],u=A[s-1];if(o.countSegment(a,u),o.isOnSegment())return o.getLocation()}return o.getLocation()}};var st=function(){},at={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){return F.orientationIndex(t,e,n)},st.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 i=t[r].x-n,A=t[r+1].y;e+=i*(t[r-1].y-A)}return e/2}if(L(arguments[0],U)){var o=arguments[0],s=o.size();if(s<3)return 0;var a=new C,u=new C,c=new C;o.getCoordinate(0,u),o.getCoordinate(1,c);var l=u.x;c.x-=l;for(var f=0,h=1;h<s-1;h++)a.y=u.y,u.x=c.x,u.y=c.y,o.getCoordinate(h+1,c),c.x-=l,f+=u.x*(a.y-c.y);return f/2}},st.distanceLineLine=function(t,e,n,r){if(t.equals(e))return st.distancePointLine(t,n,r);if(n.equals(r))return st.distancePointLine(r,t,e);var i=!1;if(j.intersects(t,e,n,r)){var A=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===A)i=!0;else{var o=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),s=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/A,a=o/A;(a<0||a>1||s<0||s>1)&&(i=!0)}}else i=!0;return i?T.min(st.distancePointLine(t,n,r),st.distancePointLine(e,n,r),st.distancePointLine(n,t,e),st.distancePointLine(r,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==N.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new C;t.getCoordinate(0,r);for(var i=r.x,A=r.y,o=1;o<e;o++){t.getCoordinate(o,r);var s=r.x,a=r.y,u=s-i,c=a-A;n+=Math.sqrt(u*u+c*c),i=s,A=a}return n},st.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var A=t[i];A.y>n.y&&(n=A,r=i)}var o=r;do{(o-=1)<0&&(o=e)}while(t[o].equals2D(n)&&o!==r);var s=r;do{s=(s+1)%e}while(t[s].equals2D(n)&&s!==r);var a=t[o],u=t[s];if(a.equals2D(n)||u.equals2D(n)||a.equals2D(u))return!1;var c=st.computeOrientation(a,n,u);return 0===c?a.x>u.x:c>0},st.locatePointInRing=function(t,e){return ot.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},st.computeOrientation=function(t,e,n){return st.orientationIndex(t,e,n)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=st.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return A.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((A.x-o.x)*(s.x-o.x)+(A.y-o.y)*(s.y-o.y))/a;if(u<=0)return A.distance(o);if(u>=1)return A.distance(s);var c=((o.y-A.y)*(s.x-o.x)-(o.x-A.x)*(s.y-o.y))/a;return Math.abs(c)*Math.sqrt(a)}},st.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],A=e[r];if(n.computeIntersection(t,i,A),n.hasIntersection())return!0}return!1},at.CLOCKWISE.get=function(){return-1},at.RIGHT.get=function(){return st.CLOCKWISE},at.COUNTERCLOCKWISE.get=function(){return 1},at.LEFT.get=function(){return st.COUNTERCLOCKWISE},at.COLLINEAR.get=function(){return 0},at.STRAIGHT.get=function(){return st.COLLINEAR},Object.defineProperties(st,at);var ut=function(){};ut.prototype.filter=function(t){},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},lt={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}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){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)}if(2===arguments.length){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)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new j(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),A=r.next(),o=i.compareTo(A);if(0!==o)return o}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,b,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},lt.serialVersionUID.get=function(){return 0x799ea46522854c00},lt.SORTINDEX_POINT.get=function(){return 0},lt.SORTINDEX_MULTIPOINT.get=function(){return 1},lt.SORTINDEX_LINESTRING.get=function(){return 2},lt.SORTINDEX_LINEARRING.get=function(){return 3},lt.SORTINDEX_MULTILINESTRING.get=function(){return 4},lt.SORTINDEX_POLYGON.get=function(){return 5},lt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},lt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},lt.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ct,lt);var ft=function(){};ft.interfaces_=function(){return[ut]},ft.filter=function(t){t.geometryChangedAction()};var ht=function(){};ht.prototype.filter=function(t){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht};var pt=function(){},dt={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}};pt.prototype.isInBoundary=function(t){},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},dt.Mod2BoundaryNodeRule.get=function(){return gt},dt.EndPointBoundaryNodeRule.get=function(){return yt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MOD2_BOUNDARY_RULE.get=function(){return new gt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new yt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return pt.MOD2_BOUNDARY_RULE},Object.defineProperties(pt,dt);var gt=function(){};gt.prototype.isInBoundary=function(t){return t%2==1},gt.prototype.interfaces_=function(){return[pt]},gt.prototype.getClass=function(){return gt};var yt=function(){};yt.prototype.isInBoundary=function(t){return t>0},yt.prototype.interfaces_=function(){return[pt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[pt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[pt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.add=function(){},vt.prototype.addAll=function(){},vt.prototype.isEmpty=function(){},vt.prototype.iterator=function(){},vt.prototype.size=function(){},vt.prototype.toArray=function(){},vt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vt);(r.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ct(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),Ct=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(bt),It=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof C&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var A=arguments[0],o=arguments[1];return this.add(A,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];if(arguments[2])for(var u=0;u<s.length;u++)this.add(s[u],a);else for(var c=s.length-1;c>=0;c--)this.add(s[c],a);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var l=arguments[0],f=arguments[1];if(!arguments[2]){var h=this.size();if(h>0){if(l>0&&this.get(l-1).equals2D(f))return null;if(l<h&&this.get(l).equals2D(f))return null}}t.prototype.add.call(this,l,f)}}else if(4===arguments.length){var p=arguments[0],d=arguments[1],g=arguments[2],y=arguments[3],_=1;g>y&&(_=-1);for(var m=g;m!==y;m+=_)this.add(p[m],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new C(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Et),xt=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};St.ForwardComparator.get=function(){return Nt},St.BidirectionalComparator.get=function(){return Dt},St.coordArrayType.get=function(){return new Array(0).fill(null)},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},xt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(xt.indexOf(r,e)<0)return r}return null},xt.scroll=function(t,e){var n=xt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);V.arraycopy(t,n,r,0,t.length-n),V.arraycopy(t,0,r,t.length-n,n),V.arraycopy(r,0,t,0,t.length)},xt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var o=0;o<r.length;o++)if(0!==A.compare(r[o],i[o]))return!1;return!0}},xt.intersection=function(t,e){for(var n=new It,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},xt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},xt.removeRepeatedPoints=function(t){return xt.hasRepeatedPoints(t)?new It(t,!1).toCoordinateArray():t},xt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},xt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,A=0;A<t.length;A++)null!==t[A]&&(r[i++]=t[A]);return r},xt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new C(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],A=arguments[2],o=arguments[3],s=arguments[4],a=0;a<s;a++)A[o+a]=new C(r[i+a])},xt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},xt.envelope=function(t){for(var e=new j,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},xt.toCoordinateArray=function(t){return t.toArray(xt.coordArrayType)},xt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},xt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},xt.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(0!==r)return r}return 1},xt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},xt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},xt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var A=0,o=e;o<=n;o++)i[A++]=t[o];return i},Object.defineProperties(xt,St);var Nt=function(){};Nt.prototype.compare=function(t,e){return xt.compare(t,e)},Nt.prototype.interfaces_=function(){return[E]},Nt.prototype.getClass=function(){return Nt};var Dt=function(){};Dt.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(0===n.length)return 0;var i=xt.compare(n,r);return xt.isEqualReversed(n,r)?0:i},Dt.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(0===n.length)return 0;for(var i=xt.increasingDirection(n),A=xt.increasingDirection(r),o=i>0?0:n.length-1,s=A>0?0:n.length-1,a=0;a<n.length;a++){var u=n[o].compareTo(r[s]);if(0!==u)return u;o+=i,s+=A}return 0},Dt.prototype.interfaces_=function(){return[E]},Dt.prototype.getClass=function(){return Dt};var Lt=function(){};Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt);(i.prototype=new Error).name="OperationNotSupported",(A.prototype=new vt).contains=function(){};var Mt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Ot(this)},e}(A),Ot=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(bt),Pt=0;(l.prototype=new Tt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},l.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Pt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var A=i.value;return i.value=e,A}i=i.right}}while(null!==i);var o={key:t,left:null,right:null,value:e,parent:n,color:Pt,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},l.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===u(s(s(t)))){var e=c(s(s(t)));1===o(e)?(a(s(t),Pt),a(e,Pt),a(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),a(s(t),Pt),a(s(s(t)),1),this.rotateRight(s(s(t))))}else{var n=u(s(s(t)));1===o(n)?(a(s(t),Pt),a(n,Pt),a(s(s(t)),1),t=s(s(t))):(t===u(s(t))&&(t=s(t),this.rotateRight(t)),a(s(t),Pt),a(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Pt},l.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=l.successor(e));)t.add(e.value);return t},l.prototype.entrySet=function(){var t=new Mt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=l.successor(e));)t.add(e);return t},l.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},l.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},l.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},l.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},l.prototype.size=function(){return this.size_};var Rt=function(){};Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},f.prototype=new A,(h.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},h.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},h.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},h.prototype.remove=function(t){throw new i},h.prototype.size=function(){return this.array_.length},h.prototype.isEmpty=function(){return 0===this.array_.length},h.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},h.prototype.iterator=function(){return new kt(this)};var kt=function(t){this.treeSet_=t,this.position_=0};kt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},kt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},kt.prototype.remove=function(){throw new i};var Bt=function(){};Bt.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var A=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<A.length;t++)i.push(A[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),A=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<A.length;t++)i.push(A[t])},Bt.asList=function(t){for(var e=new Et,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Ft=function(){},Gt={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}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.toDimensionSymbol=function(t){switch(t){case Ft.FALSE:return Ft.SYM_FALSE;case Ft.TRUE:return Ft.SYM_TRUE;case Ft.DONTCARE:return Ft.SYM_DONTCARE;case Ft.P:return Ft.SYM_P;case Ft.L:return Ft.SYM_L;case Ft.A:return Ft.SYM_A}throw new _("Unknown dimension value: "+t)},Ft.toDimensionValue=function(t){switch(R.toUpperCase(t)){case Ft.SYM_FALSE:return Ft.FALSE;case Ft.SYM_TRUE:return Ft.TRUE;case Ft.SYM_DONTCARE:return Ft.DONTCARE;case Ft.SYM_P:return Ft.P;case Ft.SYM_L:return Ft.L;case Ft.SYM_A:return Ft.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(Ft,Gt);var Ut=function(){};Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Qt=function(){};Qt.prototype.filter=function(t,e){},Qt.prototype.isDone=function(){},Qt.prototype.isGeometryChanged=function(){},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var zt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new j,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Bt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new h(Bt.asList(this._geometries)),n=new h(Bt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],A=this.getNumGeometries(),o=i.getNumGeometries(),s=0;s<A&&s<o;){var a=this.getGeometryN(s),u=i.getGeometryN(s),c=a.compareToSameClass(u,r);if(0!==c)return c;s++}return s<A?1:s<o?-1:0}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Ut)){var i=arguments[0];i.filter(this);for(var A=0;A<this._geometries.length;A++)this._geometries[A].apply(i)}else if(L(arguments[0],ut)){var o=arguments[0];o.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(o)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),qt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Vt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Rt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(zt),Vt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=pt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Vt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Vt.prototype.getBoundary=function(){return this._geom instanceof Wt?this.boundaryLineString(this._geom):this._geom instanceof qt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Vt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Vt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Vt.prototype.computeBoundaryCoordinates=function(t){var e=new Et;this._endpointMap=new l;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var A=i.next(),o=A.getValue().count;this._bnRule.isInBoundary(o)&&e.add(A.getKey())}return xt.toCoordinateArray(e)},Vt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yt,this._endpointMap.put(t,e)),e.count++},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.getBoundary=function(){return 1===arguments.length?new Vt(arguments[0]).getBoundary():2===arguments.length?new Vt(arguments[0],arguments[1]).getBoundary():void 0};var Yt=function(){this.count=null};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var jt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},jt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){};return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],A="",o=new function(){}(new function(){}(jt.getStackTrace(r))),s=0;s<i;s++)try{A+=o.readLine()+jt.NEWLINE}catch(t){if(!(t instanceof p))throw t;et.shouldNeverReachHere()}return A}},jt.split=function(t,e){for(var n=e.length,r=new Et,i=""+t,A=i.indexOf(e);A>=0;){var o=i.substring(0,A);r.add(o),A=(i=i.substring(A+n)).indexOf(e)}i.length>0&&r.add(i);for(var s=new Array(r.size()).fill(null),a=0;a<s.length;a++)s[a]=r.get(a);return s},jt.toString=function(){if(1===arguments.length){var t=arguments[0];return jt.SIMPLE_ORDINATE_FORMAT.format(t)}},jt.spaces=function(t){return jt.chars(" ",t)},Ht.NEWLINE.get=function(){return V.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}},Object.defineProperties(jt,Ht);var Xt=function(){};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),A=0;A<i;A++)n.setOrdinate(r,A,t.getOrdinate(e,A))},Xt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,U.X)===t.getOrdinate(e-1,U.X)&&t.getOrdinate(0,U.Y)===t.getOrdinate(e-1,U.Y)},Xt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var A=0;A<r;A++){var o=t.getOrdinate(i,A),s=e.getOrdinate(i,A);if(!(t.getOrdinate(i,A)===e.getOrdinate(i,A)||m.isNaN(o)&&m.isNaN(s)))return!1}return!0},Xt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Xt.copy(e,0,r,0,i),i>0)for(var A=i;A<n;A++)Xt.copy(e,i-1,r,A,1);return r},Xt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Xt.swap(t,r,e-r)},Xt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Xt.copy=function(t,e,n,r,i){for(var A=0;A<i;A++)Xt.copyCoord(t,e+A,n,r+A)},Xt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var A=0;A<n;A++)A>0&&r.append(","),r.append(jt.toString(t.getOrdinate(i,A)))}return r.append(")"),r.toString()}},Xt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Xt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(n-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(n-1,U.Y)?e:Xt.createClosedRing(t,e,n+1)},Xt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Xt.copy(e,0,r,0,i);for(var A=i;A<n;A++)Xt.copy(e,0,r,A,1);return r};var Wt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new j:this._points.expandEnvelope(new j)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Xt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Vt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Rt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),$t=function(){};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Kt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new j;var t=new j;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(L(arguments[0],ht)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],Qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),Jt=function(){};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Zt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var A=this._holes[i].getCoordinates(),o=0;o<A.length;o++)t[++e]=A[o];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(st.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(st.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var A=t.getX(0),o=t.getY(0),s=1;s<=4;s++){var a=t.getX(s),u=t.getY(s);if(a!==A==(u!==o))return!1;A=a,o=u}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,A=r._shell;if(!i.equalsExact(A,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var o=0;o<this._holes.length;o++)if(!this._holes[o].equalsExact(r._holes[o],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Bt.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);V.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=xt.minCoordinate(e.getCoordinates());xt.scroll(r,i),V.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],st.isCCW(e.getCoordinates())===n&&xt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],A=this._shell,o=i._shell,s=A.compareToSameClass(o,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=i.getNumInteriorRing(),c=0;c<a&&c<u;){var l=this.getInteriorRingN(c),f=i.getInteriorRingN(c),h=l.compareToSameClass(f,r);if(0!==h)return h;c++}return c<a?1:c<u?-1:0}},e.prototype.apply=function(t){if(L(t,ht)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,Qt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Ut))t.filter(this);else if(L(t,ut)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(zt),ee=function(t){function e(e,n){e instanceof C&&n instanceof ye&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Wt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new Et,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof zt?this.editGeometryCollection(t,e):t instanceof Zt?this.editPolygon(t,e):t instanceof Kt||t instanceof Wt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Et,i=0;i<n.getNumGeometries();i++){var A=this.edit(n.getGeometryN(i),e);null===A||A.isEmpty()||r.add(A)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===qt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new Et,A=0;A<n.getNumInteriorRing();A++){var o=this.edit(n.getInteriorRingN(A),e);null===o||o.isEmpty()||i.add(o)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return Ae},ie.CoordinateOperation.get=function(){return oe},ie.CoordinateSequenceOperation.get=function(){return se},Object.defineProperties(re,ie);var Ae=function(){};Ae.prototype.edit=function(t,e){return t},Ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},Ae.prototype.getClass=function(){return Ae};var oe=function(){};oe.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Wt?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new C}else if(L(arguments[0],U)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],A=arguments[1];this._coordinates=i,this._dimension=A,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=new Array(o).fill(null),this._dimension=s;for(var a=0;a<o;a++)this._coordinates[a]=new C}},ue={serialVersionUID:{configurable:!0}};ae.prototype.setOrdinate=function(t,e,n){switch(e){case U.X:this._coordinates[t].x=n;break;case U.Y:this._coordinates[t].y=n;break;case U.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ae.prototype.size=function(){return this._coordinates.length},ae.prototype.getOrdinate=function(t,e){switch(e){case U.X:return this._coordinates[t].x;case U.Y:return this._coordinates[t].y;case U.Z:return this._coordinates[t].z}return m.NaN},ae.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){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}},ae.prototype.getCoordinateCopy=function(t){return new C(this._coordinates[t])},ae.prototype.getDimension=function(){return this._dimension},ae.prototype.getX=function(t){return this._coordinates[t].x},ae.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ae(t,this._dimension)},ae.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ae.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ae(t,this._dimension)},ae.prototype.toString=function(){if(this._coordinates.length>0){var t=new O(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ae.prototype.getY=function(t){return this._coordinates[t].y},ae.prototype.toCoordinateArray=function(){return this._coordinates},ae.prototype.interfaces_=function(){return[U,e]},ae.prototype.getClass=function(){return ae},ue.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ae,ue);var ce=function(){},le={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ae(arguments[0]);if(L(arguments[0],U))return new ae(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ae(t):new ae(t,e)}},ce.prototype.interfaces_=function(){return[S,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},le.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},le.instanceObject.get=function(){return new ce},Object.defineProperties(ce,le);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Mt;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),he=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},pe={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};he.prototype.equals=function(t){if(!(t instanceof he))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},he.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new P(n).compareTo(new P(r))},he.prototype.getScale=function(){return this._scale},he.prototype.isFloating=function(){return this._modelType===he.FLOATING||this._modelType===he.FLOATING_SINGLE},he.prototype.getType=function(){return this._modelType},he.prototype.toString=function(){var t="UNKNOWN";return this._modelType===he.FLOATING?t="Floating":this._modelType===he.FLOATING_SINGLE?t="Floating-Single":this._modelType===he.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},he.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===he.FLOATING_SINGLE?t:this._modelType===he.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof C){var e=arguments[0];if(this._modelType===he.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},he.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===he.FLOATING?t=16:this._modelType===he.FLOATING_SINGLE?t=6:this._modelType===he.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},he.prototype.setScale=function(t){this._scale=Math.abs(t)},he.prototype.interfaces_=function(){return[e,b]},he.prototype.getClass=function(){return he},he.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},pe.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},pe.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(he,pe);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ge={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ge.serialVersionUID.get=function(){return-552860263173159e4},ge.nameToTypeMap.get=function(){return new fe},Object.defineProperties(de,ge),he.Type=de,he.FIXED=new de("FIXED"),he.FLOATING=new de("FLOATING"),he.FLOATING_SINGLE=new de("FLOATING SINGLE");var ye=function t(){this._precisionModel=new he,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],S)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof he&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new C(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new C(t.getMinX(),t.getMinY()),new C(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new C(t.getMinX(),t.getMinY()),new C(t.getMinX(),t.getMaxY()),new C(t.getMaxX(),t.getMaxY()),new C(t.getMaxX(),t.getMinY()),new C(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new Wt(this.getCoordinateSequenceFactory().create(t),this):L(t,U)?new Wt(t,this):void 0:new Wt(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){return 0===arguments.length?new qt(null,this):1===arguments.length?new qt(arguments[0],this):void 0},ye.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var A=i.next(),o=A.getClass();null===e&&(e=o),o!==e&&(n=!0),A.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ye.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Zt)return this.createMultiPolygon(ye.toPolygonArray(t));if(s instanceof Wt)return this.createMultiLineString(ye.toLineStringArray(t));if(s instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],U))return new Kt(arguments[0],this)}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new Zt(null,null,this);if(1===arguments.length){if(L(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Zt(arguments[0],arguments[1],this)},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},ye.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U))return new ee(arguments[0],this)}},ye.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Xt.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ye.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ye.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ye,_e);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ve=function(t){this.geometryFactory=t||new ye};ve.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!be[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?be[n].apply(this,[e.coordinates]):"GeometryCollection"===n?be[n].apply(this,[e.geometries]):be[n].apply(this,[e])},ve.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var be={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!be[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=be.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new C(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new C(t[0],t[1]),new C(t[2],t[1]),new C(t[2],t[3]),new C(t[0],t[3]),new C(t[0],t[1])])},Point:function(t){var e=new C(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=be.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=be.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var A=t[i],o=be.coordinates.apply(this,[A]),s=this.geometryFactory.createLinearRing(o);r.push(s)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(be.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(we.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],A=we.LineString.apply(this,[i]);e.push(A.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(we[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ee=function(t){this.geometryFactory=t||new ye,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ve(this.geometryFactory)};Ee.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===he.FIXED&&this.reducePrecision(e),e},Ee.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ce=function(){this.parser=new ve(this.geometryFactory)};Ce.prototype.write=function(t){return this.parser.write(t)};var Ie=function(){},xe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.opposite=function(t){return t===Ie.LEFT?Ie.RIGHT:t===Ie.RIGHT?Ie.LEFT:t},xe.ON.get=function(){return 0},xe.LEFT.get=function(){return 1},xe.RIGHT.get=function(){return 2},Object.defineProperties(Ie,xe),(d.prototype=new Error).name="EmptyStackException",(g.prototype=new wt).add=function(t){return this.array_.push(t),!0},g.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},g.prototype.push=function(t){return this.array_.push(t),t},g.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},g.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},g.prototype.empty=function(){return 0===this.array_.length},g.prototype.isEmpty=function(){return this.empty()},g.prototype.search=function(t){return this.array_.indexOf(t)},g.prototype.size=function(){return this.array_.length},g.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Se=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Se.prototype.getCoordinate=function(){return this._minCoord},Se.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},Se.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.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=st.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===st.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Se.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ie.LEFT;return n[e].y<n[e+1].y&&(r=Ie.RIGHT),r},Se.prototype.getEdge=function(){return this._orientedDe},Se.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Se.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Se.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ie.LEFT&&(this._orientedDe=this._minDe.getSym())},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se};var Ne=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new C(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Z),De=function(){this.array_=[]};De.prototype.addLast=function(t){this.array_.push(t)},De.prototype.removeFirst=function(){return this.array_.shift()},De.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Se};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Ne("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var A=i.next();A.setVisited(!0),this.copySymDepths(A)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ie.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ie.RIGHT)>=1&&e.getDepth(Ie.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new Mt,n=new De,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var A=i.getEdges().iterator();A.hasNext();){var o=A.next().getSym();if(!o.isVisited()){var s=o.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new j,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Le.prototype.addReachable=function(t){var e=new g;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ie.LEFT,t.getDepth(Ie.RIGHT)),e.setDepth(Ie.RIGHT,t.getDepth(Ie.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[b]},Le.prototype.getClass=function(){return Le};var Te=function t(){if(this.location=null,1===arguments.length){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[Ie.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[Ie.ON]=A,this.location[Ie.LEFT]=o,this.location[Ie.RIGHT]=s}};Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==N.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===N.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ie.ON]=this.location[Ie.ON],e[Ie.LEFT]=N.NONE,e[Ie.RIGHT]=N.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===N.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ie.LEFT];this.location[Ie.LEFT]=this.location[Ie.RIGHT],this.location[Ie.RIGHT]=t},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ie.LEFT])),t.append(N.toLocationSymbol(this.location[Ie.ON])),this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ie.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ie.ON]=t,this.location[Ie.LEFT]=e,this.location[Ie.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:N.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===N.NONE)return!0;return!1},Te.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ie.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(N.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Me=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Te(N.NONE),this.elt[1]=new Te(N.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var A=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Te(A,o,s),this.elt[1]=new Te(A,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new Te(N.NONE,N.NONE,N.NONE),this.elt[1]=new Te(N.NONE,N.NONE,N.NONE),this.elt[a].setLocations(u,c,l)}};Me.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Me.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Me.prototype.isNull=function(t){return this.elt[t].isNull()},Me.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Me.prototype.isLine=function(t){return this.elt[t].isLine()},Me.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Me.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Me.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ie.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Me.prototype.toString=function(){var t=new O;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Me.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Me.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Me.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ie.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Me.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Me.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Me.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toLineLabel=function(t){for(var e=new Me(N.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Oe=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Et,this._pts=new Et,this._label=new Me(N.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Et,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Oe.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=st.isCCW(this._ring.getCoordinates())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ne("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ne("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Oe.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var A=i;A<r.length;A++)this._pts.add(r[A])}else{var o=r.length-2;n&&(o=r.length-1);for(var s=o;s>=0;s--)this._pts.add(r[s])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Ie.RIGHT);if(n===N.NONE)return null;if(this._label.getLocation(e)===N.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var Pe=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new Et,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Pe(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),ke=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};ke.prototype.setVisited=function(t){this._isVisited=t},ke.prototype.setInResult=function(t){this._isInResult=t},ke.prototype.isCovered=function(){return this._isCovered},ke.prototype.isCoveredSet=function(){return this._isCoveredSet},ke.prototype.setLabel=function(t){this._label=t},ke.prototype.getLabel=function(){return this._label},ke.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ke.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ke.prototype.isInResult=function(){return this._isInResult},ke.prototype.isVisited=function(){return this._isVisited},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var Be=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Me(0,N.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=N.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==N.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Me(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Me)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===N.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=N.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case N.BOUNDARY:n=N.INTERIOR;break;case N.INTERIOR:default:n=N.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),Fe=function(){this.nodeMap=new l,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof C){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Be){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new Et,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===N.BOUNDARY&&e.add(r)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Ge=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Ge,Ue);var Qe=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,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3];this._edge=i,this.init(A,o),this._label=s}};Qe.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:st.computeOrientation(t._p0,t._p1,this._p1)},Qe.prototype.getDy=function(){return this._dy},Qe.prototype.getCoordinate=function(){return this._p0},Qe.prototype.setNode=function(t){this._node=t},Qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Qe.prototype.getDirectedCoordinate=function(){return this._p1},Qe.prototype.getDx=function(){return this._dx},Qe.prototype.getLabel=function(){return this._label},Qe.prototype.getEdge=function(){return this._edge},Qe.prototype.getQuadrant=function(){return this._quadrant},Qe.prototype.getNode=function(){return this._node},Qe.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Qe.prototype.computeLabel=function(t){},Qe.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=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Qe.prototype.interfaces_=function(){return[b]},Qe.prototype.getClass=function(){return Qe};var ze=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Me(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Ne("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ie.LEFT)===N.INTERIOR&&this._label.getLocation(e,Ie.RIGHT)===N.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Ie.LEFT]+"/"+this._depth[Ie.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,N.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,N.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Ie.LEFT&&(r=-1);var i=Ie.opposite(t),A=e+n*r;this.setDepth(t,e),this.setDepth(i,A)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===N.EXTERIOR&&e===N.INTERIOR?1:t===N.INTERIOR&&e===N.EXTERIOR?-1:0},e}(Qe),qe=function(){};qe.prototype.createNode=function(t){return new Be(t,null)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var Ve=function(){if(this._edges=new Et,this._nodes=null,this._edgeEndList=new Et,0===arguments.length)this._nodes=new Fe(new qe);else if(1===arguments.length){var t=arguments[0];this._nodes=new Fe(t)}};Ve.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Ve.prototype.find=function(t){return this._nodes.find(t)},Ve.prototype.addNode=function(){if(arguments[0]instanceof Be){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof C){var e=arguments[0];return this._nodes.addNode(e)}},Ve.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ve.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ve.prototype.debugPrintln=function(t){V.out.println(t)},Ve.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===N.BOUNDARY},Ve.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ve.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&st.computeOrientation(t,e,r)===st.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},Ve.prototype.getEdgeEnds=function(){return this._edgeEndList},Ve.prototype.debugPrint=function(t){V.out.print(t)},Ve.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ve.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Ve.prototype.insertEdge=function(t){this._edges.add(t)},Ve.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ve.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new ze(n,!0),i=new ze(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ve.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ve.prototype.getNodes=function(){return this._nodes.values()},Ve.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Ye=function(){this._geometryFactory=null,this._shellList=new Et;var t=arguments[0];this._geometryFactory=t};Ye.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Ye.prototype.computePolygons=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Ye.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Ne("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Et,i=t.iterator();i.hasNext();){var A=i.next();if(A.getMaxNodeDegree()>2){A.linkDirectedEdgesForMinimalEdgeRings();var o=A.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),e.add(s)):n.addAll(o)}else r.add(A)}return r},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Re(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),A=null,o=null,s=e.iterator();s.hasNext();){var a=s.next(),u=a.getLinearRing(),c=u.getEnvelopeInternal();null!==A&&(o=A.getLinearRing().getEnvelopeInternal());var l=!1;c.contains(r)&&st.isPointInRing(i,u.getCoordinates())&&(l=!0),l&&(null===A||o.contains(c))&&(A=a)}return A},Ye.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Ve.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Et,A=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(A,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var je=function(){};je.prototype.getBounds=function(){},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[je,e]},He.prototype.getClass=function(){return He};var Xe=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};Xe.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},Xe.prototype.size=function(){return this._size},Xe.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Xe.prototype.clear=function(){this._size=0,this._items.clear()},Xe.prototype.isEmpty=function(){return 0===this._size},Xe.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var We=function(){};We.prototype.visitItem=function(t){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var $e=function(){};$e.prototype.insert=function(t,e){},$e.prototype.remove=function(t,e){},$e.prototype.query=function(){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ke=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[je,e]},Ke.prototype.getClass=function(){return Ke},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Je);var Ze=function(){};Ze.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Ze.min=function(t){return Ze.sort(t),t.get(0)},Ze.sort=function(t,e){var n=t.toArray();e?Bt.sort(n,e):Bt.sort(n);for(var r=t.iterator(),i=0,A=n.length;i<A;i++)r.next(),r.set(n[i])},Ze.singletonList=function(t){var e=new Et;return e.add(t),e};var tn=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()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.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 _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var A=i.next(),o=new tn(A,e,this._itemDistance);o.getDistance()<r&&n.add(o)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[b]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Et,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof He&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],n=new Et,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ke){var A=this.itemsTree(i);null!==A&&n.add(A)}else i instanceof He?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var A=r.getChildBoundables().iterator();A.hasNext();){var o=A.next();o instanceof Ke?this.boundablesAtLevel(n,o,i):(et.isTrue(o instanceof He),-1===n&&i.add(o))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(L(arguments[2],We)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var i=arguments[0],A=arguments[2],o=arguments[1].getChildBoundables(),s=0;s<o.size();s++){var a=o.get(s);this.getIntersectsOp().intersects(a.getBounds(),i)&&(a instanceof Ke?this.query(i,a,A):a instanceof He?A.visitItem(a.getItem()):et.shouldNeverReachHere())}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var u=arguments[0],c=arguments[2],l=arguments[1].getChildBoundables(),f=0;f<l.size();f++){var h=l.get(f);this.getIntersectsOp().intersects(h.getBounds(),u)&&(h instanceof Ke?this.query(u,h,c):h instanceof He?c.add(h.getItem()):et.shouldNeverReachHere())}},en.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},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],A=this.removeItem(r,i);if(A)return!0;for(var o=null,s=r.getChildBoundables().iterator();s.hasNext();){var a=s.next();if(this.getIntersectsOp().intersects(a.getBounds(),n)&&a instanceof Ke&&(A=this.remove(n,a,i))){o=a;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),A}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Et;n.add(this.createNode(e));var r=new Et(t);Ze.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var A=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(A)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},An=function(){};An.prototype.distance=function(t,e){},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var on=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new Et,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new sn(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),A=0;A<e;A++){r[A]=new Et;for(var o=0;i.hasNext()&&o<n;){var s=i.next();r[A].add(s),o++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(L(arguments[2],We)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var i=arguments[0],A=arguments[1],o=arguments[2];t.prototype.query.call(this,i,A,o)}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new Et(t);Ze.sort(i,n.xComparator);var A=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(A,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(L(arguments[0],An)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&L(arguments[1],An)){var i=arguments[0],A=arguments[1],o=new tn(this.getRoot(),i.getRoot(),A);return this.nearestNeighbour(o)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,c=new Xe;for(c.add(s);!c.isEmpty()&&a>0;){var l=c.poll(),f=l.getDistance();if(f>=a)break;l.isLeaves()?(a=f,u=l):l.expandToQueue(c,a)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var h=arguments[2],p=new He(arguments[0],arguments[1]),d=new tn(this.getRoot(),p,h);return this.nearestNeighbour(d)[0]}},n.prototype.interfaces_=function(){return[$e,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return sn},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),sn=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new j(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),an=function(){};an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},an.relativeSign=function(t,e){return t<e?-1:t>e?1:0},an.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=an.relativeSign(e.x,n.x),i=an.relativeSign(e.y,n.y);switch(t){case 0:return an.compareValue(r,i);case 1:return an.compareValue(i,r);case 2:return an.compareValue(i,-r);case 3:return an.compareValue(-r,i);case 4:return an.compareValue(-r,-i);case 5:return an.compareValue(-i,-r);case 6:return an.compareValue(-i,r);case 7:return an.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},an.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var un=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 C(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};un.prototype.getCoordinate=function(){return this.coord},un.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},un.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:an.compare(this._segmentOctant,this.coord,e.coord)},un.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},un.prototype.isInterior=function(){return this._isInterior},un.prototype.interfaces_=function(){return[b]},un.prototype.getClass=function(){return un};var cn=function(){this._nodeMap=new l,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new It;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new P(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new C(t.coord),!1);for(var A=t.segmentIndex+1;A<=e.segmentIndex;A++)n.add(this._edge.getCoordinate(A));i&&n.add(new C(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new P(e[0])),r=i}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var A=new Array(n).fill(null),o=0;A[o++]=new C(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)A[o++]=this._edge.getCoordinate(s);return i&&(A[o]=new C(e.coord)),new pn(A,this._edge.getData())},cn.prototype.add=function(t,e){var n=new un(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Z("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Z("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("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}if(arguments[0]instanceof C&&arguments[1]instanceof C){var i=arguments[0],A=arguments[1],o=A.x-i.x,s=A.y-i.y;if(0===o&&0===s)throw new _("Cannot compute the octant for two identical points "+i);return ln.octant(o,s)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var hn=function(){};hn.prototype.addIntersection=function(t,e){},hn.prototype.interfaces_=function(){return[fn]},hn.prototype.getClass=function(){return hn};var pn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};pn.prototype.getCoordinates=function(){return this._pts},pn.prototype.size=function(){return this._pts.length},pn.prototype.getCoordinate=function(t){return this._pts[t]},pn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},pn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},pn.prototype.setData=function(t){this._data=t},pn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ln.octant(t,e)},pn.prototype.getData=function(){return this._data},pn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new C(arguments[0].getIntersection(r));this.addIntersection(i,n)}},pn.prototype.toString=function(){return J.toLineString(new ae(this._pts))},pn.prototype.getNodeList=function(){return this._nodeList},pn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},pn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},pn.prototype.interfaces_=function(){return[hn]},pn.prototype.getClass=function(){return pn},pn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return pn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new C,this.p1=new C;else if(1===arguments.length){var t=arguments[0];this.p0=new C(t.p0),this.p1=new C(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new C(e,n),this.p1=new C(r,i)}},gn={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=st.orientationIndex(this.p0,this.p1,t.p0),n=st.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof C){var r=arguments[0];return st.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof C){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new C(t);var e=this.projectionFactor(t),n=new C;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}if(arguments[0]instanceof dn){var r=arguments[0],i=this.projectionFactor(r.p0),A=this.projectionFactor(r.p1);if(i>=1&&A>=1)return null;if(i<=0&&A<=0)return null;var o=this.project(r.p0);i<0&&(o=this.p0),i>1&&(o=this.p1);var s=this.project(r.p1);return A<0&&(s=this.p0),A>1&&(s=this.p1),new dn(o,s)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.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;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,i=null,A=this.closestPoint(t.p0);r=A.distance(t.p0),n[0]=A,n[1]=t.p0;var o=this.closestPoint(t.p1);(i=o.distance(t.p1))<r&&(r=i,n[0]=o,n[1]=t.p1);var s=t.closestPoint(this.p0);(i=s.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=s);var a=t.closestPoint(this.p1);return(i=a.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=a),n},dn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.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)},dn.prototype.lineIntersection=function(t){try{return Y.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof q))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.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),i=this.p1.x-this.p0.x,A=this.p1.y-this.p0.y,o=Math.sqrt(i*i+A*A),s=0,a=0;if(0!==e){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*i/o,a=e*A/o}return new C(n-a,r+s)},dn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){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}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof C){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new C;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},dn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[b,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new C((t.x+e.x)/2,(t.y+e.y)/2)},gn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,gn);var yn=function(){this.tempEnv1=new j,this.tempEnv2=new j,this._overlapSeg1=new dn,this._overlapSeg2=new dn};yn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var _n=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};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],A=this._pts[n];if(r.tempEnv1.init(i,A),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var o=Math.trunc((e+n)/2);e<o&&this.computeSelect(t,e,o,r),o<n&&this.computeSelect(t,o,n,r)},_n.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new j(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,i,A){var o=this._pts[t],s=this._pts[e],a=n._pts[r],u=n._pts[i];if(e-t==1&&i-r==1)return A.overlap(this,t,n,r),null;if(A.tempEnv1.init(o,s),A.tempEnv2.init(a,u),!A.tempEnv1.intersects(A.tempEnv2))return null;var c=Math.trunc((t+e)/2),l=Math.trunc((r+i)/2);t<c&&(r<l&&this.computeOverlapsInternal(t,c,n,r,l,A),l<i&&this.computeOverlapsInternal(t,c,n,l,i,A)),c<e&&(r<l&&this.computeOverlapsInternal(c,e,n,r,l,A),l<i&&this.computeOverlapsInternal(c,e,n,l,i,A))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new P(e));do{var r=mn.findChainEnd(t,e);n.add(new P(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.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=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new Et,i=mn.getChainStartIndices(e),A=0;A<i.length-1;A++){var o=new _n(e,i[A],i[A+1],n);r.add(o)}return r}},mn.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 vn=function(){};vn.prototype.computeNodes=function(t){},vn.prototype.getNodedSubstrings=function(){},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var bn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};bn.prototype.setSegmentIntersector=function(t){this._segInt=t},bn.prototype.interfaces_=function(){return[vn]},bn.prototype.getClass=function(){return bn};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Et,this._index=new on,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new En(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return En},Object.defineProperties(e,n),e}(bn),En=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),A=n.getContext();this._si.processIntersections(i,e,A,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yn),Cn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(A),this.setJoinStyle(o),this.setMitreLimit(s)}},In={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}};Cn.prototype.getEndCapStyle=function(){return this._endCapStyle},Cn.prototype.isSingleSided=function(){return this._isSingleSided},Cn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Cn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Cn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Cn.JOIN_ROUND&&(this._quadrantSegments=Cn.DEFAULT_QUADRANT_SEGMENTS)},Cn.prototype.getJoinStyle=function(){return this._joinStyle},Cn.prototype.setJoinStyle=function(t){this._joinStyle=t},Cn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Cn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Cn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Cn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Cn.prototype.getMitreLimit=function(){return this._mitreLimit},Cn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Cn.prototype.setSingleSided=function(t){this._isSingleSided=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},In.CAP_ROUND.get=function(){return 1},In.CAP_FLAT.get=function(){return 2},In.CAP_SQUARE.get=function(){return 3},In.JOIN_ROUND.get=function(){return 1},In.JOIN_MITRE.get=function(){return 2},In.JOIN_BEVEL.get=function(){return 3},In.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},In.DEFAULT_MITRE_LIMIT.get=function(){return 5},In.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Cn,In);var xn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Sn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};xn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],A=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(i,A,o)&&!!this.isShallow(i,A,o,r)&&this.isShallowSampled(i,A,t,n,r)},xn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=xn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},xn.prototype.isShallowConcavity=function(t,e,n,r){return st.computeOrientation(t,e,n)===this._angleOrientation&&st.distancePointLine(e,t,n)<r},xn.prototype.isShallowSampled=function(t,e,n,r,i){var A=Math.trunc((r-n)/xn.NUM_PTS_TO_CHECK);A<=0&&(A=1);for(var o=n;o<r;o+=A)if(!this.isShallow(t,e,this._inputLine[o],i))return!1;return!0},xn.prototype.isConcave=function(t,e,n){return st.computeOrientation(t,e,n)===this._angleOrientation},xn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=st.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},xn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===xn.DELETE;)e++;return e},xn.prototype.isShallow=function(t,e,n,r){return st.distancePointLine(e,t,n)<r},xn.prototype.collapseLine=function(){for(var t=new It,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==xn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.simplify=function(t,e){return new xn(t).simplify(e)},Sn.INIT.get=function(){return 0},Sn.DELETE.get=function(){return 1},Sn.KEEP.get=function(){return 1},Sn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(xn,Sn);var Nn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Et},Dn={COORDINATE_ARRAY_TYPE:{configurable:!0}};Nn.prototype.getCoordinates=function(){return this._ptList.toArray(Nn.COORDINATE_ARRAY_TYPE)},Nn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Nn.prototype.addPt=function(t){var e=new C(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Nn.prototype.revere=function(){},Nn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Nn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Nn.prototype.toString=function(){return(new ye).createLineString(this.getCoordinates()).toString()},Nn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new C(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Nn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Dn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Nn,Dn);var Ln=function(){},Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ln.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Math.abs(i-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Ln.diff(r,i)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n)-r;return i<=-Math.PI?i+Ln.PI_TIMES_2:i>Math.PI?i-Ln.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return st.CLOCKWISE},Tn.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Ln,Tn);var Mn=function t(){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 dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Cn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},On={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}};Mn.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=st.computeOrientation(this._s0,this._s1,this._s2),r=n===st.CLOCKWISE&&this._side===Ie.LEFT||n===st.COUNTERCLOCKWISE&&this._side===Ie.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Mn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Ie.LEFT,this._distance,r);var i=new dn;this.computeOffsetSegment(n,Ie.RIGHT,this._distance,i);var A=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,A);switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Cn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Cn.CAP_SQUARE:var a=new C;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new C(r.p1.x+a.x,r.p1.y+a.y),c=new C(i.p1.x+a.x,i.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(c)}},Mn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Mn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,A=null;try{A=Y.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:A.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof q))throw t;A=new C(0,0),i=!1}i?this._segList.addPt(A):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Mn.prototype.addFilletCorner=function(t,e,n,r,i){var A=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,A),a=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,a);r===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,i),this._segList.addPt(n)},Mn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Mn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Cn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Cn.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))},Mn.prototype.createSquare=function(t){this._segList.addPt(new C(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new C(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Mn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Mn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Mn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Mn.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)},Mn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,A=Ln.angle(i,this._seg0.p0),o=Ln.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,s=Ln.normalize(A+o),a=Ln.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(o)),l=i.x+u*Math.cos(a),f=i.y+u*Math.sin(a),h=new C(l,f),p=new dn(i,h),d=p.pointAlongOffset(1,c),g=p.pointAlongOffset(1,-c);this._side===Ie.LEFT?(this._segList.addPt(d),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(d))},Mn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ie.LEFT?1:-1,A=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,s=Math.sqrt(A*A+o*o),a=i*n*A/s,u=i*n*o/s;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+a,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+a},Mn.prototype.addFilletArc=function(t,e,n,r,i){var A=r===st.CLOCKWISE?-1:1,o=Math.abs(e-n),s=Math.trunc(o/this._filletAngleQuantum+.5);if(s<1)return null;for(var a=o/s,u=0,c=new C;u<o;){var l=e+A*u;c.x=t.x+i*Math.cos(l),c.y=t.y+i*Math.sin(l),this._segList.addPt(c),u+=a}},Mn.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*Mn.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 C((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 C((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)}},Mn.prototype.createCircle=function(t){var e=new C(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Mn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Mn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Nn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Mn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Cn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Cn.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,st.CLOCKWISE,this._distance))},Mn.prototype.closeRing=function(){this._segList.closeRing()},Mn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Mn,On);var Pn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Pn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var A=i.getCoordinates();return n&&xt.reverse(A),A},Pn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=xn.simplify(t,-r),A=i.length-1;n.initSideSegments(i[A],i[A-1],Ie.LEFT),n.addFirstSegment();for(var o=A-2;o>=0;o--)n.addNextSegment(i[o],!0)}else{n.addSegments(t,!1);var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ie.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},Pn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ie.RIGHT&&(r=-r);var i=xn.simplify(t,r),A=i.length-1;n.initSideSegments(i[A-1],i[0],e);for(var o=1;o<=A;o++){var s=1!==o;n.addNextSegment(i[o],s)}n.closeRing()},Pn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=xn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ie.LEFT);for(var A=2;A<=i;A++)e.addNextSegment(r[A],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var o=xn.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],Ie.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},Pn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:e.createCircle(t);break;case Cn.CAP_SQUARE:e.createSquare(t)}},Pn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)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 i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Pn.prototype.getBufferParameters=function(){return this._bufParams},Pn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Pn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Pn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Pn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=xn.simplify(t,-r),A=i.length-1;n.initSideSegments(i[A],i[A-1],Ie.LEFT),n.addFirstSegment();for(var o=A-2;o>=0;o--)n.addNextSegment(i[o],!0)}else{var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ie.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},Pn.prototype.getSegGen=function(t){return new Mn(this._precisionModel,this._bufParams,t)},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new C(t[n]);return e};var Rn=function(){this._subgraphs=null,this._seg=new dn,this._cga=new st;var t=arguments[0];this._subgraphs=t},kn={DepthSegment:{configurable:!0}};Rn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new Et,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof C&&arguments[1]instanceof ze){for(var A=arguments[0],o=arguments[1],s=arguments[2],a=o.getEdge().getCoordinates(),u=0;u<a.length-1;u++)if(this._seg.p0=a[u],this._seg.p1=a[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<A.x||this._seg.isHorizontal()||A.y<this._seg.p0.y||A.y>this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,A)===st.RIGHT)){var c=o.getDepth(Ie.LEFT);this._seg.p0.equals(a[u])||(c=o.getDepth(Ie.RIGHT));var l=new Bn(this._seg,c);s.add(l)}}else if(L(arguments[2],wt)&&arguments[0]instanceof C&&L(arguments[1],wt))for(var f=arguments[0],h=arguments[2],p=arguments[1].iterator();p.hasNext();){var d=p.next();d.isForward()&&this.findStabbedSegments(f,d,h)}},Rn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Ze.min(e)._leftDepth},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},kn.DepthSegment.get=function(){return Bn},Object.defineProperties(Rn,kn);var Bn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};Bn.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 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Bn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Bn.prototype.toString=function(){return this._upwardSeg.toString()},Bn.prototype.interfaces_=function(){return[b]},Bn.prototype.getClass=function(){return Bn};var Fn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Fn.prototype.area=function(){return Fn.area(this.p0,this.p1,this.p2)},Fn.prototype.signedArea=function(){return Fn.signedArea(this.p0,this.p1,this.p2)},Fn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return Fn.interpolateZ(t,this.p0,this.p1,this.p2)},Fn.prototype.longestSideLength=function(){return Fn.longestSideLength(this.p0,this.p1,this.p2)},Fn.prototype.isAcute=function(){return Fn.isAcute(this.p0,this.p1,this.p2)},Fn.prototype.circumcentre=function(){return Fn.circumcentre(this.p0,this.p1,this.p2)},Fn.prototype.area3D=function(){return Fn.area3D(this.p0,this.p1,this.p2)},Fn.prototype.centroid=function(){return Fn.centroid(this.p0,this.p1,this.p2)},Fn.prototype.inCentre=function(){return Fn.inCentre(this.p0,this.p1,this.p2)},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.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)},Fn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Fn.det=function(t,e,n,r){return t*r-e*n},Fn.interpolateZ=function(t,e,n,r){var i=e.x,A=e.y,o=n.x-i,s=r.x-i,a=n.y-A,u=r.y-A,c=o*u-s*a,l=t.x-i,f=t.y-A,h=(u*l-s*f)/c,p=(-a*l+o*f)/c;return e.z+h*(n.z-e.z)+p*(r.z-e.z)},Fn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),A=n.distance(t),o=r;return i>o&&(o=i),A>o&&(o=A),o},Fn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},Fn.circumcentre=function(t,e,n){var r=n.x,i=n.y,A=t.x-r,o=t.y-i,s=e.x-r,a=e.y-i,u=2*Fn.det(A,o,s,a),c=Fn.det(o,A*A+o*o,a,s*s+a*a),l=Fn.det(A,A*A+o*o,s,s*s+a*a);return new C(r-c/u,i+l/u)},Fn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Y(t.x+n/2,t.y+r/2,1),A=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(i,A)},Fn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),A=n.x-t.x,o=n.y-t.y;return new C(t.x+i*A,t.y+i*o)},Fn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,A=e.z-t.z,o=n.x-t.x,s=n.y-t.y,a=n.z-t.z,u=i*a-A*s,c=A*o-r*a,l=r*s-i*o,f=u*u+c*c+l*l;return Math.sqrt(f)/2},Fn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new C(r,i)},Fn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),A=t.distance(e),o=r+i+A,s=(r*t.x+i*e.x+A*n.x)/o,a=(r*t.y+i*e.y+A*n.y)/o;return new C(s,a)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ie.LEFT;this._distance<0&&(e=-this._distance,n=Ie.RIGHT);var r=t.getExteriorRing(),i=xt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,N.EXTERIOR,N.INTERIOR);for(var A=0;A<t.getNumInteriorRing();A++){var o=t.getInteriorRingN(A),s=xt.removeRepeatedPoints(o.getCoordinates());this._distance>0&&this.isErodedCompletely(o,-this._distance)||this.addPolygonRing(s,e,Ie.opposite(n),N.INTERIOR,N.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Fn(t[0],t[1],t[2]),r=n.inCentre();return st.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=xt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new pn(t,new Me(0,N.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var A=r,o=i;t.length>=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(A=i,o=r,n=Ie.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,A,o)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Zt?this.addPolygon(t):t instanceof Wt?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof qt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Un=function(){};Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Qn=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()};Qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Qn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof zt?(this._subcollectionIterator=new Qn(t),this._subcollectionIterator.next()):t},Qn.prototype.remove=function(){throw new Error(this.getClass().getName())},Qn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Qn.prototype.interfaces_=function(){return[bt]},Qn.prototype.getClass=function(){return Qn},Qn.isAtomic=function(t){return!(t instanceof zt)};var zn=function(){this._geom=null;var t=arguments[0];this._geom=t};zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(zn.isPointInRing(t,i))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Zt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new Qn(e);n.hasNext();){var r=n.next();if(r!==e&&zn.containsPoint(t,r))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?N.EXTERIOR:zn.containsPoint(t,e)?N.INTERIOR:N.EXTERIOR};var qn=function(){this._edgeMap=new l,this._edgeList=null,this._ptInAreaLocation=[N.NONE,N.NONE]};qn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},qn.prototype.propagateSideLabels=function(t){for(var e=N.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ie.LEFT)!==N.NONE&&(e=r.getLocation(t,Ie.LEFT))}if(e===N.NONE)return null;for(var i=e,A=this.iterator();A.hasNext();){var o=A.next(),s=o.getLabel();if(s.getLocation(t,Ie.ON)===N.NONE&&s.setLocation(t,Ie.ON,i),s.isArea(t)){var a=s.getLocation(t,Ie.LEFT),u=s.getLocation(t,Ie.RIGHT);if(u!==N.NONE){if(u!==i)throw new Ne("side location conflict",o.getCoordinate());a===N.NONE&&et.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),i=a}else et.isTrue(s.getLocation(t,Ie.LEFT)===N.NONE,"found single null side"),s.setLocation(t,Ie.RIGHT,i),s.setLocation(t,Ie.LEFT,i)}}},qn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},qn.prototype.print=function(t){V.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},qn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},qn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Ie.LEFT);et.isTrue(r!==N.NONE,"Found unlabelled area edge");for(var i=r,A=this.iterator();A.hasNext();){var o=A.next().getLabel();et.isTrue(o.isArea(t),"Found non-area edge");var s=o.getLocation(t,Ie.LEFT),a=o.getLocation(t,Ie.RIGHT);if(s===a)return!1;if(a!==i)return!1;i=s}return!0},qn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},qn.prototype.iterator=function(){return this.getEdges().iterator()},qn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Et(this._edgeMap.values())),this._edgeList},qn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===N.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},qn.prototype.toString=function(){var t=new O;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},qn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},qn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===N.BOUNDARY&&(e[i]=!0);for(var A=this.iterator();A.hasNext();)for(var o=A.next(),s=o.getLabel(),a=0;a<2;a++)if(s.isAnyNull(a)){var u=N.NONE;if(e[a])u=N.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(a,c,t)}s.setAllLocationsIfNull(a,u)}},qn.prototype.getDegree=function(){return this._edgeMap.size()},qn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var Vn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),A=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!A.isInResult())continue;e=A,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Ne("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),A=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(A)?n:Ge.isNorthern(i)||Ge.isNorthern(A)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){V.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Et;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ie.LEFT),r=t.getDepth(Ie.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Ne("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var A=arguments[1],o=arguments[2],s=arguments[0];s<A;s++){var a=this._edgeList.get(s);a.setEdgeDepths(Ie.RIGHT,o),o=a.getDepth(Ie.LEFT)}return o}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var A=this._resultAreaEdgeList.get(i),o=A.getSym();switch(null===e&&A.getEdgeRing()===t&&(e=A),r){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;n=o,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(A.getEdgeRing()!==t)continue;n.setNextMin(A),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=N.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=N.INTERIOR;break}if(r.isInResult()){t=N.EXTERIOR;break}}}if(t===N.NONE)return null;for(var i=t,A=this.iterator();A.hasNext();){var o=A.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(i===N.INTERIOR):(o.isInResult()&&(i=N.EXTERIOR),s.isInResult()&&(i=N.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Me(N.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var A=r.getLocation(i);A!==N.INTERIOR&&A!==N.BOUNDARY||this._label.setLocation(i,N.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Be(t,new Vn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qe),jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};jn.prototype.compareTo=function(t){var e=t;return jn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},jn.prototype.interfaces_=function(){return[b]},jn.prototype.getClass=function(){return jn},jn.orientation=function(t){return 1===xt.increasingDirection(t)},jn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,A=r?1:-1,o=e?t.length:-1,s=r?n.length:-1,a=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[a].compareTo(n[u]);if(0!==c)return c;var l=(a+=i)===o,f=(u+=A)===s;if(l&&!f)return-1;if(!l&&f)return 1;if(l&&f)return 0}};var Hn=function(){this._edges=new Et,this._ocaMap=new l};Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;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 jn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new jn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Xn=function(){};Xn.prototype.processIntersections=function(t,e,n,r){},Xn.prototype.isDone=function(){},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var Wn=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};Wn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Wn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Wn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Wn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Wn.prototype.getLineIntersector=function(){return this._li},Wn.prototype.hasProperIntersection=function(){return this._hasProper},Wn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,A,o,s),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)))},Wn.prototype.hasIntersection=function(){return this._hasIntersection},Wn.prototype.isDone=function(){return!1},Wn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Wn.prototype.interfaces_=function(){return[Xn]},Wn.prototype.getClass=function(){return Wn},Wn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var $n=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new C(t),this.segmentIndex=e,this.dist=n};$n.prototype.getSegmentIndex=function(){return this.segmentIndex},$n.prototype.getCoordinate=function(){return this.coord},$n.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},$n.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},$n.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},$n.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},$n.prototype.getDistance=function(){return this.dist},$n.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},$n.prototype.interfaces_=function(){return[b]},$n.prototype.getClass=function(){return $n};var Kn=function(){this._nodeMap=new l,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Kn.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)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var A=new Array(n).fill(null),o=0;A[o++]=new C(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)A[o++]=this.edge.pts[s];return i&&(A[o]=e.coord),new nr(A,new Me(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new $n(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new P(e));do{var r=this.findChainEnd(t,e);n.add(new P(r)),e=r}while(e<t.length-1);return Jn.toIntArray(n)},Jn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.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 Zn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new j,this.env2=new j;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Jn;this.startIndex=e.getChainStartIndices(this.pts)};Zn.prototype.getCoordinates=function(){return this.pts},Zn.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},Zn.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},Zn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){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(6===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=arguments[5],c=this.pts[i],l=this.pts[A],f=o.pts[s],h=o.pts[a];if(A-i==1&&a-s==1)return u.addIntersections(this.e,i,o.e,s),null;if(this.env1.init(c,l),this.env2.init(f,h),!this.env1.intersects(this.env2))return null;var p=Math.trunc((i+A)/2),d=Math.trunc((s+a)/2);i<p&&(s<d&&this.computeIntersectsForChain(i,p,o,s,d,u),d<a&&this.computeIntersectsForChain(i,p,o,d,a,u)),p<A&&(s<d&&this.computeIntersectsForChain(p,A,o,s,d,u),d<a&&this.computeIntersectsForChain(p,A,o,d,a,u))}},Zn.prototype.getStartIndexes=function(){return this.startIndex},Zn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var tr=function t(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ie.RIGHT]-this._depth[t][Ie.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?N.EXTERIOR:N.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==N.EXTERIOR&&r!==N.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],A=arguments[1];arguments[2]===N.INTERIOR&&this._depth[i][A]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===N.EXTERIOR?0:t===N.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Me.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,A=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(n.pts[o])||(r=!1),this.pts[o].equals2D(n.pts[--A])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Zn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new j;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new C(t.getIntersection(r)),A=e,o=t.getEdgeDistance(n,r),s=A+1;if(s<this.pts.length){var a=this.pts[s];i.equals2D(a)&&(A=s,o=0)}this.eiList.add(i,A,o)},e.prototype.toString=function(){var t=new O;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ie.ON),e.getLocation(1,Ie.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ie.LEFT),e.getLocation(1,Ie.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ie.RIGHT),e.getLocation(1,Ie.RIGHT),2))},e}(ke),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),A=e.getDepthDelta()+i;e.setDepthDelta(A)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new Et,r=t.iterator();r.hasNext();){var i=r.next(),A=i.getRightmostCoordinate(),o=new Rn(n).getDepth(A);i.computeDepth(o),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new Et,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Le;i.create(r),e.add(i)}}return Ze.sort(e,Ze.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Wn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Pn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ve(new Yn),this._graph.addEdges(this._edgeList.getEdges());var A=this.createSubgraphs(this._graph),o=new Ye(this._geomFact);this.buildSubgraphs(A,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),A=i.getCoordinates();if(2!==A.length||!A[0].equals2D(A[1])){var o=i.getData(),s=new nr(i.getCoordinates(),new Me(o));this.insertUniqueEdge(s)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ie.LEFT),n=t.getLocation(0,Ie.RIGHT);return e===N.INTERIOR&&n===N.EXTERIOR?1:e===N.EXTERIOR&&n===N.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ye,n=new Et;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){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(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],A=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=A,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&V.out.println(n)}},ir.prototype.scale=function(){if(L(arguments[0],vt)){for(var t=arguments[0],e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new pn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],A=new Array(i.length).fill(null),o=0;o<i.length;o++)A[o]=new C(Math.round((i[o].x-this._offsetX)*this._scaleFactor),Math.round((i[o].y-this._offsetY)*this._scaleFactor),i[o].z);return xt.removeRepeatedPoints(A)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[vn]},ir.prototype.getClass=function(){return ir};var Ar=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},or={fact:{configurable:!0}};Ar.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),A=1;A<i.length-1;A++)if(i[A].equals(n))throw new Z("found endpt/interior pt intersection at index "+A+" :pt "+n)},Ar.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],A=arguments[1],o=i.getCoordinates(),s=A.getCoordinates(),a=0;a<o.length-1;a++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(i,a,A,u);else if(4===arguments.length){var c=arguments[0],l=arguments[1],f=arguments[2],h=arguments[3];if(c===f&&l===h)return null;var p=c.getCoordinates()[l],d=c.getCoordinates()[l+1],g=f.getCoordinates()[h],y=f.getCoordinates()[h+1];if(this._li.computeIntersection(p,d,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,p,d)||this.hasInteriorIntersection(this._li,g,y)))throw new Z("found non-noded intersection at "+p+"-"+d+" and "+g+"-"+y)}},Ar.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Ar.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},Ar.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},Ar.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Z("found non-noded collapse at "+Ar.fact.createLineString([t,e,n]))},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},or.fact.get=function(){return new ye},Object.defineProperties(Ar,or);var sr=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 _("Scale factor must be non-zero");1!==e&&(this._pt=new C(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new C,this._p1Scaled=new C),this.initCorners(this._pt)},ar={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),A=Math.max(t.y,e.y),o=this._maxx<n||this._minx>r||this._maxy<i||this._miny>A;if(o)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(o&&s),"Found bad envelope test"),s},sr.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)},sr.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sr.prototype.getCoordinate=function(){return this._originalPt},sr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new j(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sr.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()))))},sr.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)))))},sr.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)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ar.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sr,ar);var ur=function(){this.tempEnv1=new j,this.selectedSegment=new dn};ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var cr=function(){this._index=null;var t=arguments[0];this._index=t},lr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),A=new fr(e,n,r);return this._index.query(i,{interfaces_:function(){return[We]},visitItem:function(t){t.select(i,A)}}),A.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},lr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(cr,lr);var fr=function(t){function e(){t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur),hr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};hr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,A,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)this._interiorIntersections.add(this._li.getIntersection(a));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},hr.prototype.isDone=function(){return!1},hr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},hr.prototype.interfaces_=function(){return[Xn]},hr.prototype.getClass=function(){return hr};var pr=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 it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};pr.prototype.checkCorrectness=function(t){var e=pn.getNodedSubstrings(t),n=new Ar(e);try{n.checkValid()}catch(t){if(!(t instanceof z))throw t;t.printStackTrace()}},pr.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},pr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},pr.prototype.findInteriorIntersections=function(t,e){var n=new hr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},pr.prototype.computeVertexSnaps=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof pn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var A=new sr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(A,n,i)&&n.addIntersection(r[i],i)}},pr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},pr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},pr.prototype.interfaces_=function(){return[vn]},pr.prototype.getClass=function(){return pr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Cn,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},gr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new ir(new pr(new he(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ne))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),i=new he(r);this.bufferFixedPrecision(i)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===he.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Z))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new dr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new dr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof Cn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new dr(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var A=arguments[1],o=arguments[2],s=arguments[3],a=new dr(arguments[0]);return a.setQuadrantSegments(o),a.setEndCapStyle(s),a.getResultGeometry(A)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=T.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),A=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,A)},gr.CAP_ROUND.get=function(){return Cn.CAP_ROUND},gr.CAP_BUTT.get=function(){return Cn.CAP_FLAT},gr.CAP_FLAT.get=function(){return Cn.CAP_FLAT},gr.CAP_SQUARE.get=function(){return Cn.CAP_SQUARE},gr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,gr);var yr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(t){return this._pt[t]},yr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},yr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){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(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},yr.prototype.getDistance=function(){return this._distance},yr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof Wt&&arguments[1]instanceof C)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new dn,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var A=r.closestPoint(t);e.setMinimum(A,t)}else if(arguments[2]instanceof yr&&arguments[0]instanceof Zt&&arguments[1]instanceof C){var o=arguments[0],s=arguments[1],a=arguments[2];_r.computeDistance(o.getExteriorRing(),s,a);for(var u=0;u<o.getNumInteriorRing();u++)_r.computeDistance(o.getInteriorRingN(u),s,a)}else if(arguments[2]instanceof yr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var c=arguments[0],l=arguments[1],f=arguments[2];if(c instanceof Wt)_r.computeDistance(c,l,f);else if(c instanceof Zt)_r.computeDistance(c,l,f);else if(c instanceof zt)for(var h=c,p=0;p<h.getNumGeometries();p++){var d=h.getGeometryN(p);_r.computeDistance(d,l,f)}else f.setMinimum(c.getCoordinate(),l)}else if(arguments[2]instanceof yr&&arguments[0]instanceof dn&&arguments[1]instanceof C){var g=arguments[1],y=arguments[2],_=arguments[0].closestPoint(g);y.setMinimum(_,g)}};var mr=function(t){this._maxPtDist=new yr,this._inputGeom=t||null},vr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},vr.MaxPointDistanceFilter.get=function(){return br},vr.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(mr,vr);var br=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};br.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},br.prototype.getMaxPointDistance=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[ht]},br.prototype.getClass=function(){return br};var wr=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new C((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[Qt]},wr.prototype.getClass=function(){return wr};var Er=function(t){this._comps=t||null};Er.prototype.filter=function(t){t instanceof Zt&&this._comps.add(t)},Er.prototype.interfaces_=function(){return[Ut]},Er.prototype.getClass=function(){return Er},Er.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Er.getPolygons(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof zt&&e.apply(new Er(n)),n}};var Cr=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Cr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Wt&&this._lines.add(t)},Cr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Cr.prototype.interfaces_=function(){return[ut]},Cr.prototype.getClass=function(){return Cr},Cr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Cr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Cr.getLines(e,n))}},Cr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Cr.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],vt)&&L(arguments[1],vt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();Cr.getLines(r,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var i=arguments[0],A=arguments[1],o=new Et;return i.apply(new Cr(o,A)),o}if(arguments[0]instanceof ct&&L(arguments[1],vt)){var s=arguments[0],a=arguments[1];return s instanceof Wt?a.add(s):s.apply(new Cr(a)),a}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],vt)&&L(arguments[1],vt)){for(var u=arguments[1],c=arguments[2],l=arguments[0].iterator();l.hasNext();){var f=l.next();Cr.getLines(f,u,c)}return u}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&L(arguments[1],vt)){var h=arguments[1],p=arguments[2];return arguments[0].apply(new Cr(h,p)),h}}};var Ir=function(){if(this._boundaryRule=pt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}};Ir.prototype.locateInternal=function(){if(arguments[0]instanceof C&&arguments[1]instanceof Zt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return N.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===N.EXTERIOR)return N.EXTERIOR;if(r===N.BOUNDARY)return N.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var A=e.getInteriorRingN(i),o=this.locateInPolygonRing(t,A);if(o===N.INTERIOR)return N.EXTERIOR;if(o===N.BOUNDARY)return N.BOUNDARY}return N.INTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof Wt){var s=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(s))return N.EXTERIOR;var u=a.getCoordinates();return a.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?st.isOnLine(s,u)?N.INTERIOR:N.EXTERIOR:N.BOUNDARY}if(arguments[0]instanceof C&&arguments[1]instanceof Kt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?N.INTERIOR:N.EXTERIOR}},Ir.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?st.locatePointInRing(t,e.getCoordinates()):N.EXTERIOR},Ir.prototype.intersects=function(t,e){return this.locate(t,e)!==N.EXTERIOR},Ir.prototype.updateLocationInfo=function(t){t===N.INTERIOR&&(this._isIn=!0),t===N.BOUNDARY&&this._numBoundaries++},Ir.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof qt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var A=e,o=0;o<A.getNumGeometries();o++){var s=A.getGeometryN(o);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof zt)for(var a=new Qn(e);a.hasNext();){var u=a.next();u!==e&&this.computeLocation(t,u)}},Ir.prototype.locate=function(t,e){return e.isEmpty()?N.EXTERIOR:e instanceof Wt||e instanceof Zt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?N.BOUNDARY:this._numBoundaries>0||this._isIn?N.INTERIOR:N.EXTERIOR)},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir};var xr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Sr={INSIDE_AREA:{configurable:!0}};xr.prototype.isInsideArea=function(){return this._segIndex===xr.INSIDE_AREA},xr.prototype.getCoordinate=function(){return this._pt},xr.prototype.getGeometryComponent=function(){return this._component},xr.prototype.getSegmentIndex=function(){return this._segIndex},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(xr,Sr);var Nr=function(t){this._pts=t||null};Nr.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Nr.prototype.interfaces_=function(){return[Ut]},Nr.prototype.getClass=function(){return Nr},Nr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Ze.singletonList(t):Nr.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof zt&&e.apply(new Nr(n)),n}};var Dr=function(){this._locations=null;var t=arguments[0];this._locations=t};Dr.prototype.filter=function(t){(t instanceof Kt||t instanceof Wt||t instanceof Zt)&&this._locations.add(new xr(t,0,t.getCoordinate()))},Dr.prototype.interfaces_=function(){return[Ut]},Dr.prototype.getClass=function(){return Dr},Dr.getLocations=function(t){var e=new Et;return t.apply(new Dr(e)),e};var Lr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ir,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=Er.getPolygons(this._geom[e]);if(i.size()>0){var A=Dr.getLocations(this._geom[r]);if(this.computeContainmentDistance(A,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=0;u<o.size();u++)for(var c=o.get(u),l=0;l<s.size();l++)if(this.computeContainmentDistance(c,s.get(l),a),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof xr&&arguments[1]instanceof Zt){var f=arguments[0],h=arguments[1],p=arguments[2],d=f.getCoordinate();if(N.EXTERIOR!==this._ptLocator.locate(d,h))return this._minDistance=0,p[0]=f,p[1]=new xr(h,d),null}},Lr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),A=0;A<e.size();A++){var o=e.get(A);if(this.computeMinDistance(i,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Cr.getLines(this._geom[0]),n=Cr.getLines(this._geom[1]),r=Nr.getPoints(this._geom[0]),i=Nr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),A=0;A<r.length-1;A++){var o=st.distancePointLine(i,r[A],r[A+1]);if(o<this._minDistance){this._minDistance=o;var s=new dn(r[A],r[A+1]).closestPoint(i);n[0]=new xr(t,A,s),n[1]=new xr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Wt){var a=arguments[0],u=arguments[1],c=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var l=a.getCoordinates(),f=u.getCoordinates(),h=0;h<l.length-1;h++)for(var p=0;p<f.length-1;p++){var d=st.distanceLineLine(l[h],l[h+1],f[p],f[p+1]);if(d<this._minDistance){this._minDistance=d;var g=new dn(l[h],l[h+1]),y=new dn(f[p],f[p+1]),_=g.closestPoints(y);c[0]=new xr(a,h,_[0]),c[1]=new xr(u,p,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),A=0;A<e.size();A++){var o=e.get(A),s=i.getCoordinate().distance(o.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,n[0]=new xr(i,0,i.getCoordinate()),n[1]=new xr(o,0,o.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),A=0;A<e.size();A++){var o=e.get(A);if(this.computeMinDistance(i,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Tr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},Tr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){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(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Tr.prototype.toString=function(){return J.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){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)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Mr=function(){};Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.computeDistance=function(){if(arguments[2]instanceof Tr&&arguments[0]instanceof Wt&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,i=t.getCoordinates(),A=0;A<i.length-1;A++){r.setCoordinates(i[A],i[A+1]);var o=r.closestPoint(e);n.setMinimum(o,e)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof Zt&&arguments[1]instanceof C){var s=arguments[0],a=arguments[1],u=arguments[2];Mr.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)Mr.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var l=arguments[0],f=arguments[1],h=arguments[2];if(l instanceof Wt)Mr.computeDistance(l,f,h);else if(l instanceof Zt)Mr.computeDistance(l,f,h);else if(l instanceof zt)for(var p=l,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);Mr.computeDistance(g,f,h)}else h.setMinimum(l.getCoordinate(),f)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof C){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var Or=function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Pr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.prototype.computeOrientedDistance=function(t,e,n){var r=new Rr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new kr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length)return new Or(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Or(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Pr.MaxPointDistanceFilter.get=function(){return Rr},Pr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Or,Pr);var Rr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Mr,this._geom=null;var t=arguments[0];this._geom=t};Rr.prototype.filter=function(t){this._minPtDist.initialize(),Mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Rr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Rr.prototype.interfaces_=function(){return[ht]},Rr.prototype.getClass=function(){return Rr};var kr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,A=(r.y-n.y)/this._numSubSegs,o=0;o<this._numSubSegs;o++){var s=n.x+o*i,a=n.y+o*A,u=new C(s,a);this._minPtDist.initialize(),Mr.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},kr.prototype.isDone=function(){return!1},kr.prototype.isGeometryChanged=function(){return!1},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[Qt]},kr.prototype.getClass=function(){return kr};var Br=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},Fr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Br.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+J.toLineString(i[0],i[1])+")"}},Br.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Br.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Br.VERBOSE&&V.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Br.prototype.checkNegativeValid=function(){if(!(this._input instanceof Zt||this._input instanceof ne||this._input instanceof zt))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)},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+J.toLineString(i[0],i[1])+" )"}},Br.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)},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.prototype.getPolygonLines=function(t){for(var e=new Et,n=new Cr(e),r=Er.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Br.prototype.getErrorMessage=function(){return this._errMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Fr.VERBOSE.get=function(){return!1},Fr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Fr);var Gr=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},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.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},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new j(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new j(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")},Gr.prototype.checkDistance=function(){var t=new Br(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")},Gr.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")},Gr.prototype.checkPolygonal=function(){this._result instanceof Zt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;V.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var Qr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Qr.prototype.getCoordinates=function(){return this._pts},Qr.prototype.size=function(){return this._pts.length},Qr.prototype.getCoordinate=function(t){return this._pts[t]},Qr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Qr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ln.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Qr.prototype.setData=function(t){this._data=t},Qr.prototype.getData=function(){return this._data},Qr.prototype.toString=function(){return J.toLineString(new ae(this._pts))},Qr.prototype.interfaces_=function(){return[fn]},Qr.prototype.getClass=function(){return Qr};var zr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zr.prototype.getIntersectionSegments=function(){return this._intSegments},zr.prototype.count=function(){return this._intersectionCount},zr.prototype.getIntersections=function(){return this._intersections},zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,A,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=A,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zr.prototype.interfaces_=function(){return[Xn]},zr.prototype.getClass=function(){return zr},zr.createAllIntersectionsFinder=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e},zr.createAnyIntersectionFinder=function(t){return new zr(t)},zr.createIntersectionCounter=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var qr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};qr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},qr.prototype.getIntersections=function(){return this._segInt.getIntersections()},qr.prototype.isValid=function(){return this.execute(),this._isValid},qr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},qr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ne(this.getErrorMessage(),this._segInt.getInteriorIntersection())},qr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3])},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.computeIntersections=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Vr=function t(){this._nv=null;var e=arguments[0];this._nv=new qr(t.toSegmentStrings(e))};Vr.prototype.checkValid=function(){this._nv.checkValid()},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.toSegmentStrings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Qr(r.getCoordinates(),r))}return e},Vr.checkValid=function(t){new Vr(t).checkValid()};var Yr=function(t){this._mapOp=t};Yr.prototype.map=function(t){for(var e=new Et,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ye.toGeometryArray(e))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.map=function(t,e){return new Yr(e).map(t)};var jr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Et,this._resultLineList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};jr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},jr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},jr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},jr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!xi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},jr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},jr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},jr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},jr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(xi.isResultOfOp(r,e)&&e===xi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Et;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==xi.INTERSECTION)){var r=n.getLabel();xi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Xr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Xr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new Et,A=0;A<t.getNumInteriorRing();A++){var o=this.transformLinearRing(t.getInteriorRingN(A),t);null===o||o.isEmpty()||(o instanceof ee||(n=!1),i.add(o))}if(n)return this._factory.createPolygon(r,i.toArray([]));var s=new Et;return null!==r&&s.add(r),s.addAll(i),this._factory.buildGeometry(s)},Xr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Xr.prototype.getInputGeometry=function(){return this._inputGeom},Xr.prototype.transformMultiLineString=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Xr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Xr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformMultiPoint=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Xr.prototype.transformMultiPolygon=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Xr.prototype.copy=function(t){return t.copy()},Xr.prototype.transformGeometryCollection=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ye.toGeometryArray(n)):this._factory.buildGeometry(n)},Xr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Wt)return this.transformLineString(t,null);if(t instanceof qt)return this.transformMultiLineString(t,null);if(t instanceof Zt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Xr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var Wr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Wt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Wr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),A=this.findSnapForVertex(i,e);null!==A&&(t.set(r,new C(A)),0===r&&this._isClosed&&t.set(t.size()-1,new C(A)))}},Wr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Wr.prototype.snapTo=function(t){var e=new It(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Wr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],A=this.findSegmentIndexToSnap(i,t);A>=0&&t.add(A+1,new C(i),!1)}},Wr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var A=this._seg.distance(t);A<this._snapTolerance&&A<n&&(n=A,r=i)}return r},Wr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var $r=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};$r.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Jr(e,n).transform(this._srcGeom)},$r.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Jr(t,n,!0).transform(this._srcGeom),i=r;return e&&L(i,Jt)&&(i=r.buffer(0)),i},$r.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},$r.prototype.extractTargetCoordinates=function(t){for(var e=new h,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},$r.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.snap=function(t,e,n){var r=new Array(2).fill(null),i=new $r(t);r[0]=i.snapTo(e,n);var A=new $r(e);return r[1]=A.snapTo(r[0],n),r},$r.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=$r.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===he.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],A=arguments[1];return Math.min($r.computeOverlaySnapTolerance(i),$r.computeOverlaySnapTolerance(A))}},$r.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*$r.SNAP_PRECISION_FACTOR},$r.snapToSelf=function(t,e,n){return new $r(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties($r,Kr);var Jr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr),Zr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Zr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Zr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Zr.signExpBits(this._commonBits),this._isFirst=!1,null):Zr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Zr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Zr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Zr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.getBit=function(t,e){return t&1<<e?1:0},Zr.signExpBits=function(t){return t>>52},Zr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Zr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Zr.getBit(t,r)!==Zr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new C(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Zr,this._commonBitsY=new Zr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new C(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ht]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.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)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Qt]},ri.prototype.getClass=function(){return ri};var ii=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()};ii.prototype.selfSnap=function(t){return new $r(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,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},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=xi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||V.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=$r.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return $r.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,xi.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,xi.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,xi.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,xi.DIFFERENCE)};var Ai=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Ai.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=xi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Z))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Z?r:t}return e},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.overlayOp=function(t,e,n){return new Ai(t,e).getResultGeometry(n)},Ai.union=function(t,e){return Ai.overlayOp(t,e,xi.UNION)},Ai.intersection=function(t,e){return Ai.overlayOp(t,e,xi.INTERSECTION)},Ai.symDifference=function(t,e){return Ai.overlayOp(t,e,xi.SYMDIFFERENCE)},Ai.difference=function(t,e){return Ai.overlayOp(t,e,xi.DIFFERENCE)};var oi=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};oi.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=A}},ai={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.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},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[b]},si.prototype.getClass=function(){return si},ai.INSERT.get=function(){return 1},ai.DELETE.get=function(){return 2},Object.defineProperties(si,ai);var ui=function(){};ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var ci=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};ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],A=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,A,o,s),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))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var li=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Ze.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ci&&L(arguments[0],wt)&&L(arguments[1],wt)){var r=arguments[0],i=arguments[1],A=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(A)}else if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&arguments[1]instanceof ci){var o=arguments[0],s=arguments[1];arguments[2]?this.addEdges(o,null):this.addEdges(o),this.computeIntersections(s)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var A=new oi(n,i),o=new si(e,n.getMinX(i),A);this.events.add(o),this.events.add(new si(n.getMaxX(i),o))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),A=t;A<e;A++){var o=this.events.get(A);if(o.isInsert()){var s=o.getObject();n.isSameLabel(o)||(i.computeIntersections(s,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ui),fi=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},hi={NodeComparator:{configurable:!0}};fi.prototype.getMin=function(){return this._min},fi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fi.prototype.getMax=function(){return this._max},fi.prototype.toString=function(){return J.toLineString(new C(this._min,0),new C(this._max,0))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},hi.NodeComparator.get=function(){return pi},Object.defineProperties(fi,hi);var pi=function(){};pi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,A=(r._min+r._max)/2;return i<A?-1:i>A?1:0},pi.prototype.interfaces_=function(){return[E]},pi.prototype.getClass=function(){return pi};var di=function(t){function e(){t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),gi=function(t){function e(){t.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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),yi=function(){this._leaves=new Et,this._root=null,this._level=0};yi.prototype.buildTree=function(){Ze.sort(this._leaves,new fi.NodeComparator);for(var t=this._leaves,e=null,n=new Et;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},yi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new di(t,e,n))},yi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},yi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yi.prototype.printNode=function(t){V.out.println(J.toLineString(new C(t._min,this._level),new C(t._max,this._level)))},yi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new gi(t.get(n),t.get(n+1));e.add(i)}}},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var _i=function(){this._items=new Et};_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[We]},_i.prototype.getClass=function(){return _i};var mi=function(){this._index=null;var t=arguments[0];if(!L(t,Jt))throw new _("Argument must be Polygonal");this._index=new wi(t)},vi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mi.prototype.locate=function(t){var e=new ot(t),n=new bi(e);return this._index.query(t.y,t.y,n),e.getLocation()},mi.prototype.interfaces_=function(){return[Un]},mi.prototype.getClass=function(){return mi},vi.SegmentVisitor.get=function(){return bi},vi.IntervalIndexedGeometry.get=function(){return wi},Object.defineProperties(mi,vi);var bi=function(){this._counter=null;var t=arguments[0];this._counter=t};bi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},bi.prototype.interfaces_=function(){return[We]},bi.prototype.getClass=function(){return bi};var wi=function(){this._index=new yi;var t=arguments[0];this.init(t)};wi.prototype.init=function(t){for(var e=Cr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2];this._index.query(r,i,A)}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Ei=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new fe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ir,2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2];this._argIndex=i,this._parentGeom=A,this._boundaryNodeRule=o,null!==A&&this.add(A)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;N.NONE,r.getLocation(t,Ie.ON)===N.BOUNDARY&&i++;var A=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,A)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var A=this.createEdgeSetIntersector(),o=this._parentGeom instanceof ee||this._parentGeom instanceof Zt||this._parentGeom instanceof ne,s=n||!o;return A.computeIntersections(this._edges,i,s),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ci(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,N.INTERIOR)}else if(arguments[0]instanceof C){var e=arguments[0];this.insertPoint(this._argIndex,e,N.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),N.EXTERIOR,N.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,N.INTERIOR,N.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],N.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],N.BOUNDARY)},e.prototype.addLineString=function(t){var e=xt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Me(this._argIndex,N.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===N.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=xt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,A=n;st.isCCW(r)&&(i=n,A=e);var o=new nr(r,new Me(this._argIndex,N.BOUNDARY,i,A));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],N.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Me(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new li},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var A=i.next();this.addSelfIntersectionNode(t,A.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Zt)this.addPolygon(e);else if(e instanceof Wt)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof qt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?N.BOUNDARY:N.INTERIOR},e}(Ve),Ci=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.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 Ei(0,e,r),this._arg[1]=new Ei(1,n,r)}else if(3===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2];i.getPrecisionModel().compareTo(A.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(A.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,o),this._arg[1]=new Ei(1,A,o)}};Ci.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ci.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Ii=function(){};Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],Ii.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Et,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(L(arguments[0],vt)&&L(arguments[1],Ii.MapOp)){for(var A=arguments[0],o=arguments[1],s=new Et,a=A.iterator();a.hasNext();){var u=a.next(),c=o.map(u);null!==c&&s.add(c)}return s}},Ii.MapOp=function(){};var xi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Ir,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new Et,this._resultLineList=new Et,this._resultPointList=new Et,this._graph=new Ve(new Yn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var A=new Et;return A.addAll(t),A.addAll(n),A.addAll(r),A.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(A)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==N.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Et,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){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 e=new Et;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Vr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ye(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new jr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ie.RIGHT),i.getLocation(1,Ie.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Ie.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ie.LEFT,r.getLocation(i,Ie.LEFT)),et.isTrue(!r.isNull(i,Ie.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ie.RIGHT,r.getLocation(i,Ie.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ci);xi.overlayOp=function(t,e,n){return new xi(t,e).getResultGeometry(n)},xi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return xi.createEmptyResult(xi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Yr.map(t,{interfaces_:function(){return[Ii.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.INTERSECTION)},xi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xi.createEmptyResult(xi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.SYMDIFFERENCE)},xi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),A=-1;switch(t){case xi.INTERSECTION:A=Math.min(r,i);break;case xi.UNION:A=Math.max(r,i);break;case xi.DIFFERENCE:A=r;break;case xi.SYMDIFFERENCE:A=Math.max(r,i)}return A},xi.createEmptyResult=function(t,e,n,r){var i=null;switch(xi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},xi.difference=function(t,e){return t.isEmpty()?xi.createEmptyResult(xi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.DIFFERENCE))},xi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return xi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],A=arguments[1],o=arguments[2];switch(i===N.BOUNDARY&&(i=N.INTERIOR),A===N.BOUNDARY&&(A=N.INTERIOR),o){case xi.INTERSECTION:return i===N.INTERIOR&&A===N.INTERIOR;case xi.UNION:return i===N.INTERIOR||A===N.INTERIOR;case xi.DIFFERENCE:return i===N.INTERIOR&&A!==N.INTERIOR;case xi.SYMDIFFERENCE:return i===N.INTERIOR&&A!==N.INTERIOR||i!==N.INTERIOR&&A===N.INTERIOR}return!1}},xi.INTERSECTION=1,xi.UNION=2,xi.DIFFERENCE=3,xi.SYMDIFFERENCE=4;var Si=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ir,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Si.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?N.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Ni;t.apply(e);var n=e.getLinework(),r=ye.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Ni=function(){this._linework=null,this._linework=new Et};Ni.prototype.getLinework=function(){return this._linework},Ni.prototype.filter=function(t){if(t instanceof Zt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Ni.prototype.interfaces_=function(){return[Ut]},Ni.prototype.getClass=function(){return Ni};var Di=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Di.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Di.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Di.prototype.getPoints=function(t){for(var e=new Et,n=Cr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Di.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,A=e.y-t.y,o=Math.sqrt(i*i+A*A),s=n*i/o,a=n*A/o,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var l=new C(u-a,c+s);r.add(l)}if(this._doRight){var f=new C(u+a,c-s);r.add(f)}},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var Li=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new Et;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]},Ti={TOLERANCE:{configurable:!0}};Li.prototype.reportResult=function(t,e,n){V.out.println("Overlay result invalid - A:"+N.toLocationSymbol(e[0])+" B:"+N.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+N.toLocationSymbol(e[2]))},Li.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Li.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Li.hasLocation(this._location,N.BOUNDARY)||this.isValidResult(r,this._location)}},Li.prototype.addTestPts=function(t){var e=new Di(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Li.prototype.isValidResult=function(t,e){var n=xi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===N.INTERIOR);return r||this.reportResult(t,e,n),r},Li.prototype.getInvalidLocation=function(){return this._invalidLocation},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Li.computeBoundaryDistanceTolerance=function(t,e){return Math.min($r.computeSizeBasedSnapTolerance(t),$r.computeSizeBasedSnapTolerance(e))},Li.isValid=function(t,e,n,r){return new Li(t,e,r).isValid(n)},Ti.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Li,Ti);var Mi=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Mi.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Mi.prototype.combine=function(){for(var t=new Et,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.combine=function(){if(1===arguments.length)return new Mi(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Mi(Mi.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Mi(Mi.createList(n,r,i)).combine()}},Mi.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Mi.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Et;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],A=arguments[2],o=new Et;return o.add(r),o.add(i),o.add(A),o}};var Oi=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Et)},Pi={STRTREE_NODE_CAPACITY:{configurable:!0}};Oi.prototype.reduceToGeometries=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next(),i=null;L(r,wt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Oi.prototype.extractByEnvelope=function(t,e,n){for(var r=new Et,i=0;i<e.getNumGeometries();i++){var A=e.getGeometryN(i);A.getEnvelopeInternal().intersects(t)?r.add(A):n.add(A)}return this._geomFactory.buildGeometry(r)},Oi.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Mi.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Oi.prototype.union=function(){if(null===this._inputPolys)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 on(Oi.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();return this.unionTree(r)},Oi.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Oi.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Oi.getGeometry(e,n),Oi.getGeometry(e,n+1));var A=Math.trunc((r+n)/2),o=this.binaryUnion(e,n,A),s=this.binaryUnion(e,A,r);return this.unionSafe(o,s)}},Oi.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Oi.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Oi.prototype.unionActual=function(t,e){return Oi.restrictToPolygons(t.union(e))},Oi.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Oi.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Et,i=this.extractByEnvelope(n,t,r),A=this.extractByEnvelope(n,e,r),o=this.unionActual(i,A);return r.add(o),Mi.combine(r)},Oi.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.restrictToPolygons=function(t){if(L(t,Jt))return t;var e=Er.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ye.toPolygonArray(e))},Oi.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Oi.union=function(t){return new Oi(t).union()},Pi.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Oi,Pi);var Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xi.createEmptyResult(xi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ai.overlayOp(t,e,xi.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Ce,t.OverlayOp=xi,t.UnionOp=Ri,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})})(Mt.exports);var Ot=Mt.exports;function Pt(){return new Rt}function Rt(){this.reset()}Rt.prototype={constructor:Rt,reset:function(){this.s=this.t=0},add:function(t){Bt(kt,t,this.t),Bt(this,kt.s,this.s),this.s?this.t+=kt.t:this.s=kt.t},valueOf:function(){return this.s}};var kt=new Rt;function Bt(t,e,n){var r=t.s=e+n,i=r-e,A=r-i;t.t=e-A+(n-i)}var Ft=1e-6,Gt=Math.PI,Ut=Gt/2,Qt=Gt/4,zt=2*Gt,qt=180/Gt,Vt=Gt/180,Yt=Math.abs,jt=Math.atan,Ht=Math.atan2,Xt=Math.cos,Wt=Math.sin,$t=Math.sqrt;function Kt(t){return t>1?0:t<-1?Gt:Math.acos(t)}function Jt(t){return t>1?Ut:t<-1?-Ut:Math.asin(t)}function Zt(){}function te(t,e){t&&ie.hasOwnProperty(t.type)&&ie[t.type](t,e)}var ee,ne,re={Feature:function(t,e){te(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)te(n[r].geometry,e)}},ie={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Ae(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ae(n[r],e,0)},Polygon:function(t,e){oe(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)oe(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)te(n[r],e)}};function Ae(t,e,n){var r,i=-1,A=t.length-n;for(e.lineStart();++i<A;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function oe(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Ae(t[n],e,1);e.polygonEnd()}function se(t){return[Ht(t[1],t[0]),Jt(t[2])]}function ae(t){var e=t[0],n=t[1],r=Xt(n);return[r*Xt(e),r*Wt(e),Wt(n)]}function ue(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ce(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function le(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function fe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function he(t){var e=$t(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function pe(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function de(t,e){return[t>Gt?t-zt:t<-Gt?t+zt:t,e]}function ge(t){return function(e,n){return[(e+=t)>Gt?e-zt:e<-Gt?e+zt:e,n]}}function ye(t){var e=ge(t);return e.invert=ge(-t),e}function _e(t,e){var n=Xt(t),r=Wt(t),i=Xt(e),A=Wt(e);function o(t,e){var o=Xt(e),s=Xt(t)*o,a=Wt(t)*o,u=Wt(e),c=u*n+s*r;return[Ht(a*i-c*A,s*n-u*r),Jt(c*i+a*A)]}return o.invert=function(t,e){var o=Xt(e),s=Xt(t)*o,a=Wt(t)*o,u=Wt(e),c=u*i-a*A;return[Ht(a*i+u*A,s*n+c*r),Jt(c*n-s*r)]},o}function me(t,e){(e=ae(e))[0]-=t,he(e);var n=Kt(-e[1]);return((-e[2]<0?-n:n)+zt-Ft)%zt}function ve(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Zt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function be(t,e){return Yt(t[0]-e[0])<Ft&&Yt(t[1]-e[1])<Ft}function we(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ee(t,e,n,r,i){var A,o,s=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(be(r,o)){for(i.lineStart(),A=0;A<e;++A)i.point((r=t[A])[0],r[1]);i.lineEnd()}else s.push(n=new we(r,t,null,!0)),a.push(n.o=new we(r,null,n,!1)),s.push(n=new we(o,t,null,!1)),a.push(n.o=new we(o,null,n,!0))}}),s.length){for(a.sort(e),Ce(s),Ce(a),A=0,o=a.length;A<o;++A)a[A].e=n=!n;for(var u,c,l=s[0];;){for(var f=l,h=!0;f.v;)if((f=f.n)===l)return;u=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(A=0,o=u.length;A<o;++A)i.point((c=u[A])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(h)for(u=f.p.z,A=u.length-1;A>=0;--A)i.point((c=u[A])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);i.lineEnd()}}}function Ce(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Ie(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function xe(t){for(var e,n,r,i=t.length,A=-1,o=0;++A<i;)o+=t[A].length;for(n=new Array(o);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n}Pt(),Pt(),Pt(),de.invert=de,1===(ee=Ie).length&&(ne=ee,ee=function(t,e){return Ie(ne(t),e)});var Se=1e9,Ne=-Se;function De(t,e,n,r){function i(i,A){return t<=i&&i<=n&&e<=A&&A<=r}function A(i,A,s,u){var c=0,l=0;if(null==i||(c=o(i,s))!==(l=o(A,s))||a(i,A)<0^s>0)do{u.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==l);else u.point(A[0],A[1])}function o(r,i){return Yt(r[0]-t)<Ft?i>0?0:3:Yt(r[0]-n)<Ft?i>0?2:1:Yt(r[1]-e)<Ft?i>0?1:0:i>0?3:2}function s(t,e){return a(t.x,e.x)}function a(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var a,u,c,l,f,h,p,d,g,y,_,m=o,v=ve(),b={point:w,lineStart:function(){b.point=E,u&&u.push(c=[]);y=!0,g=!1,p=d=NaN},lineEnd:function(){a&&(E(l,f),h&&g&&v.rejoin(),a.push(v.result()));b.point=w,g&&m.lineEnd()},polygonStart:function(){m=v,a=[],u=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=u.length;n<i;++n)for(var A,o,s=u[n],a=1,c=s.length,l=s[0],f=l[0],h=l[1];a<c;++a)A=f,o=h,f=(l=s[a])[0],h=l[1],o<=r?h>r&&(f-A)*(r-o)>(h-o)*(t-A)&&++e:h<=r&&(f-A)*(r-o)<(h-o)*(t-A)&&--e;return e}(),n=_&&e,i=(a=xe(a)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),A(null,null,1,o),o.lineEnd()),i&&Ee(a,s,e,A,o),o.polygonEnd());m=o,a=u=c=null}};function w(t,e){i(t,e)&&m.point(t,e)}function E(A,o){var s=i(A,o);if(u&&c.push([A,o]),y)l=A,f=o,h=s,y=!1,s&&(m.lineStart(),m.point(A,o));else if(s&&g)m.point(A,o);else{var a=[p=Math.max(Ne,Math.min(Se,p)),d=Math.max(Ne,Math.min(Se,d))],v=[A=Math.max(Ne,Math.min(Se,A)),o=Math.max(Ne,Math.min(Se,o))];!function(t,e,n,r,i,A){var o,s=t[0],a=t[1],u=0,c=1,l=e[0]-s,f=e[1]-a;if(o=n-s,l||!(o>0)){if(o/=l,l<0){if(o<u)return;o<c&&(c=o)}else if(l>0){if(o>c)return;o>u&&(u=o)}if(o=i-s,l||!(o<0)){if(o/=l,l<0){if(o>c)return;o>u&&(u=o)}else if(l>0){if(o<u)return;o<c&&(c=o)}if(o=r-a,f||!(o>0)){if(o/=f,f<0){if(o<u)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>u&&(u=o)}if(o=A-a,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o<u)return;o<c&&(c=o)}return u>0&&(t[0]=s+u*l,t[1]=a+u*f),c<1&&(e[0]=s+c*l,e[1]=a+c*f),!0}}}}}(a,v,t,e,n,r)?s&&(m.lineStart(),m.point(A,o),_=!1):(g||(m.lineStart(),m.point(a[0],a[1])),m.point(v[0],v[1]),s||m.lineEnd(),_=!1)}p=A,d=o,g=s}return b}}var Le=Pt();function Te(t){return t}Pt(),Pt(),Pt();var Me=1/0,Oe=Me,Pe=-Me,Re=Pe,ke={point:function(t,e){t<Me&&(Me=t);t>Pe&&(Pe=t);e<Oe&&(Oe=e);e>Re&&(Re=e)},lineStart:Zt,lineEnd:Zt,polygonStart:Zt,polygonEnd:Zt,result:function(){var t=[[Me,Oe],[Pe,Re]];return Pe=Re=-(Oe=Me=1/0),t}};function Be(t,e,n,r){return function(i,A){var o,s,a,u=e(A),c=i.invert(r[0],r[1]),l=ve(),f=e(l),h=!1,p={point:d,lineStart:y,lineEnd:_,polygonStart:function(){p.point=m,p.lineStart=v,p.lineEnd=b,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=_,s=xe(s);var t=function(t,e){var n=e[0],r=e[1],i=[Wt(n),-Xt(n),0],A=0,o=0;Le.reset();for(var s=0,a=t.length;s<a;++s)if(c=(u=t[s]).length)for(var u,c,l=u[c-1],f=l[0],h=l[1]/2+Qt,p=Wt(h),d=Xt(h),g=0;g<c;++g,f=_,p=v,d=b,l=y){var y=u[g],_=y[0],m=y[1]/2+Qt,v=Wt(m),b=Xt(m),w=_-f,E=w>=0?1:-1,C=E*w,I=C>Gt,x=p*v;if(Le.add(Ht(x*E*Wt(C),d*b+x*Xt(C))),A+=I?w+E*zt:w,I^f>=n^_>=n){var S=ce(ae(l),ae(y));he(S);var N=ce(i,S);he(N);var D=(I^w>=0?-1:1)*Jt(N[2]);(r>D||r===D&&(S[0]||S[1]))&&(o+=I^w>=0?1:-1)}}return(A<-Ft||A<Ft&&Le<-Ft)^1&o}(o,c);s.length?(h||(A.polygonStart(),h=!0),Ee(s,Ge,t,n,A)):t&&(h||(A.polygonStart(),h=!0),A.lineStart(),n(null,null,1,A),A.lineEnd()),h&&(A.polygonEnd(),h=!1),s=o=null},sphere:function(){A.polygonStart(),A.lineStart(),n(null,null,1,A),A.lineEnd(),A.polygonEnd()}};function d(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&A.point(e,n)}function g(t,e){var n=i(t,e);u.point(n[0],n[1])}function y(){p.point=g,u.lineStart()}function _(){p.point=d,u.lineEnd()}function m(t,e){a.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function v(){f.lineStart(),a=[]}function b(){m(a[0][0],a[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),u=l.result(),c=u.length;if(a.pop(),o.push(a),a=null,c)if(1&i){if((e=(n=u[0]).length-1)>0){for(h||(A.polygonStart(),h=!0),A.lineStart(),t=0;t<e;++t)A.point((r=n[t])[0],r[1]);A.lineEnd()}}else c>1&&2&i&&u.push(u.pop().concat(u.shift())),s.push(u.filter(Fe))}return p}}function Fe(t){return t.length>1}function Ge(t,e){return((t=t.x)[0]<0?t[1]-Ut-Ft:Ut-t[1])-((e=e.x)[0]<0?e[1]-Ut-Ft:Ut-e[1])}Pt();var Ue=Be(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(A,o){var s=A>0?Gt:-Gt,a=Yt(A-n);Yt(a-Gt)<Ft?(t.point(n,r=(r+o)/2>0?Ut:-Ut),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(A,r),e=0):i!==s&&a>=Gt&&(Yt(n-i)<Ft&&(n-=i*Ft),Yt(A-s)<Ft&&(A-=s*Ft),r=function(t,e,n,r){var i,A,o=Wt(t-n);return Yt(o)>Ft?jt((Wt(e)*(A=Xt(r))*Wt(n)-Wt(r)*(i=Xt(e))*Wt(t))/(i*A*o)):(e+r)/2}(n,r,A,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=A,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Ut,r.point(-Gt,i),r.point(0,i),r.point(Gt,i),r.point(Gt,0),r.point(Gt,-i),r.point(0,-i),r.point(-Gt,-i),r.point(-Gt,0),r.point(-Gt,i);else if(Yt(t[0]-e[0])>Ft){var A=t[0]<e[0]?Gt:-Gt;i=n*A/2,r.point(-A,i),r.point(0,i),r.point(A,i)}else r.point(e[0],e[1])},[-Gt,-Ut]);function Qe(t,e){var n=Xt(t),r=n>0,i=Yt(n)>Ft;function A(t,e){return Xt(t)*Xt(e)>n}function o(t,e,r){var i=[1,0,0],A=ce(ae(t),ae(e)),o=ue(A,A),s=A[0],a=o-s*s;if(!a)return!r&&t;var u=n*o/a,c=-n*s/a,l=ce(i,A),f=fe(i,u);le(f,fe(A,c));var h=l,p=ue(f,h),d=ue(h,h),g=p*p-d*(ue(f,f)-1);if(!(g<0)){var y=$t(g),_=fe(h,(-p-y)/d);if(le(_,f),_=se(_),!r)return _;var m,v=t[0],b=e[0],w=t[1],E=e[1];b<v&&(m=v,v=b,b=m);var C=b-v,I=Yt(C-Gt)<Ft;if(!I&&E<w&&(m=w,w=E,E=m),I||C<Ft?I?w+E>0^_[1]<(Yt(_[0]-v)<Ft?w:E):w<=_[1]&&_[1]<=E:C>Gt^(v<=_[0]&&_[0]<=b)){var x=fe(h,(-p+y)/d);return le(x,f),[_,se(x)]}}}function s(e,n){var i=r?t:Gt-t,A=0;return e<-i?A|=1:e>i&&(A|=2),n<-i?A|=4:n>i&&(A|=8),A}return Be(A,function(t){var e,n,a,u,c;return{lineStart:function(){u=a=!1,c=1},point:function(l,f){var h,p=[l,f],d=A(l,f),g=r?d?0:s(l,f):d?s(l+(l<0?Gt:-Gt),f):0;if(!e&&(u=a=d)&&t.lineStart(),d!==a&&(!(h=o(e,p))||be(e,h)||be(p,h))&&(p[0]+=Ft,p[1]+=Ft,d=A(p[0],p[1])),d!==a)c=0,d?(t.lineStart(),h=o(p,e),t.point(h[0],h[1])):(h=o(e,p),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(i&&e&&r^d){var y;g&n||!(y=o(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!d||e&&be(e,p)||t.point(p[0],p[1]),e=p,a=d,n=g},lineEnd:function(){a&&t.lineEnd(),e=null},clean:function(){return c|(u&&a)<<1}}},function(n,r,i,A){!function(t,e,n,r,i,A){if(n){var o=Xt(e),s=Wt(e),a=r*n;null==i?(i=e+r*zt,A=e-a/2):(i=me(o,i),A=me(o,A),(r>0?i<A:i>A)&&(i+=r*zt));for(var u,c=i;r>0?c>A:c<A;c-=a)u=se([o,-s*Xt(c),-s*Wt(c)]),t.point(u[0],u[1])}}(A,t,e,i,n,r)},r?[0,-t]:[-Gt,t-Gt])}function ze(t){return function(e){var n=new qe;for(var r in t)n[r]=t[r];return n.stream=e,n}}function qe(){}function Ve(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],A=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=A&&t.clipExtent(null),function(t,e){t&&re.hasOwnProperty(t.type)?re[t.type](t,e):te(t,e)}(n,t.stream(ke));var o=ke.result(),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),a=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return null!=A&&t.clipExtent(A),t.scale(150*s).translate([a,u])}qe.prototype={constructor:qe,point:function(t,e){this.stream.point(t,e)},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()}};var Ye=Xt(30*Vt);function je(t,e){return+e?function(t,e){function n(r,i,A,o,s,a,u,c,l,f,h,p,d,g){var y=u-r,_=c-i,m=y*y+_*_;if(m>4*e&&d--){var v=o+f,b=s+h,w=a+p,E=$t(v*v+b*b+w*w),C=Jt(w/=E),I=Yt(Yt(w)-1)<Ft||Yt(A-l)<Ft?(A+l)/2:Ht(b,v),x=t(I,C),S=x[0],N=x[1],D=S-r,L=N-i,T=_*D-y*L;(T*T/m>e||Yt((y*D+_*L)/m-.5)>.3||o*f+s*h+a*p<Ye)&&(n(r,i,A,o,s,a,S,N,I,v/=E,b/=E,w,d,g),g.point(S,N),n(S,N,I,v,b,w,u,c,l,f,h,p,d,g))}}return function(e){var r,i,A,o,s,a,u,c,l,f,h,p,d={point:g,lineStart:y,lineEnd:m,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=y}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,d.point=_,e.lineStart()}function _(r,i){var A=ae([r,i]),o=t(r,i);n(c,l,u,f,h,p,c=o[0],l=o[1],u=r,f=A[0],h=A[1],p=A[2],16,e),e.point(c,l)}function m(){d.point=g,e.lineEnd()}function v(){y(),d.point=b,d.lineEnd=w}function b(t,e){_(r=t,e),i=c,A=l,o=f,s=h,a=p,d.point=_}function w(){n(c,l,u,f,h,p,i,A,r,o,s,a,16,e),d.lineEnd=m,m()}return d}}(t,e):function(t){return ze({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var He=ze({point:function(t,e){this.stream.point(t*Vt,e*Vt)}});function Xe(t){return function(t){var e,n,r,i,A,o,s,a,u,c,l=150,f=480,h=250,p=0,d=0,g=0,y=0,_=0,m=null,v=Ue,b=null,w=Te,E=.5,C=je(S,E);function I(t){return[(t=A(t[0]*Vt,t[1]*Vt))[0]*l+n,r-t[1]*l]}function x(t){return(t=A.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*qt,t[1]*qt]}function S(t,i){return[(t=e(t,i))[0]*l+n,r-t[1]*l]}function N(){A=pe(i=function(t,e,n){return(t%=zt)?e||n?pe(ye(t),_e(e,n)):ye(t):e||n?_e(e,n):de}(g,y,_),e);var t=e(p,d);return n=f-t[0]*l,r=h+t[1]*l,D()}function D(){return u=c=null,I}return I.stream=function(t){return u&&c===t?u:u=He(v(i,C(w(c=t))))},I.clipAngle=function(t){return arguments.length?(v=+t?Qe(m=t*Vt,6*Vt):(m=null,Ue),D()):m*qt},I.clipExtent=function(t){return arguments.length?(w=null==t?(b=o=s=a=null,Te):De(b=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1]),D()):null==b?null:[[b,o],[s,a]]},I.scale=function(t){return arguments.length?(l=+t,N()):l},I.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],N()):[f,h]},I.center=function(t){return arguments.length?(p=t[0]%360*Vt,d=t[1]%360*Vt,N()):[p*qt,d*qt]},I.rotate=function(t){return arguments.length?(g=t[0]%360*Vt,y=t[1]%360*Vt,_=t.length>2?t[2]%360*Vt:0,N()):[g*qt,y*qt,_*qt]},I.precision=function(t){return arguments.length?(C=je(S,E=t*t),D()):$t(E)},I.fitExtent=function(t,e){return Ve(I,t,e)},I.fitSize=function(t,e){return function(t,e,n){return Ve(t,[[0,0],e],n)}(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&x,N()}}(function(){return t})()}function We(t){return function(e,n){var r=Xt(e),i=Xt(n),A=t(r*i);return[A*i*Wt(e),A*Wt(n)]}}function $e(t){return function(e,n){var r=$t(e*e+n*n),i=t(r),A=Wt(i),o=Xt(i);return[Ht(e*A,r*o),Jt(r&&n*A/r)]}}We(function(t){return $t(2/(1+t))}).invert=$e(function(t){return 2*Jt(t/2)});var Ke=We(function(t){return(t=Kt(t))&&t/Wt(t)});function Je(){return Xe(Ke).scale(79.4188).clipAngle(179.999)}function Ze(t,e){return[t,e]}function tn(t,e,n,r){var i=t.properties||{},A="Feature"===t.type?t.geometry:t;if("GeometryCollection"===A.type){var o=[];return Et(t,function(t){var i=tn(t,e,n,r);i&&o.push(i)}),ct(o)}var s=function(t){var e=It(t).geometry.coordinates,n=[-e[0],-e[1]];return Je().rotate(n).scale(At)}(A),a={type:A.type,coordinates:nn(A.coordinates,s)},u=(new Ot.GeoJSONReader).read(a),c=lt(ft(e,n),"meters"),l=Ot.BufferOp.bufferOp(u,c,r);if(!en((l=(new Ot.GeoJSONWriter).write(l)).coordinates))return st({type:l.type,coordinates:rn(l.coordinates,s)},i)}function en(t){return Array.isArray(t[0])?en(t[0]):isNaN(t[0])}function nn(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return nn(t,e)})}function rn(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return rn(t,e)})}Ke.invert=$e(function(t){return t}),Ze.invert=Ze;var An=6378137;function on(t){return function(t,e,n){var r=n;return Et(t,function(t,n,i,A,o){r=e(r,t,n,i,A,o)}),r}(t,function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return sn(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=sn(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},0)}function sn(t){var e=0;if(t&&t.length>0){e+=Math.abs(an(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(an(t[n]))}return e}function an(t){var e,n,r,i,A,o,s=0,a=t.length;if(a>2){for(o=0;o<a;o++)o===a-2?(r=a-2,i=a-1,A=0):o===a-1?(r=a-1,i=0,A=1):(r=o,i=o+1,A=o+2),e=t[r],n=t[i],s+=(un(t[A][0])-un(e[0]))*Math.sin(un(n[1]));s=s*An*An/2}return s}function un(t){return t*Math.PI/180}function cn(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),A=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[n,r];return ut([[o,[i,r],[i,A],[n,A],o]],e.properties,{bbox:t,id:e.id})}const ln={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},fn={halfAnHour:"0.5",oneHour:"1",twoHours:"2",fourHours:"4"},hn={DATA:"/one-layer/v5/{res}/{hexId}"},pn={[O.SMALL]:0,[O.MEDIUM]:1,[O.LARGE]:1,[O.CORRIDOR]:1},dn={[O.SMALL]:2,[O.MEDIUM]:1,[O.LARGE]:2.5,[O.CORRIDOR]:1},gn="polygon",yn="isCorridorMode",_n="isForecastEnabled",mn="aircraftCategory",vn="hoursAgo",bn=({coordinates:t})=>{const e=structuredClone(t);return wn({coordinates:e})},wn=({coordinates:t})=>t.map((e,n)=>{const r=t.at(n-1);return r&&Math.abs(r[0]-e[0])>180?(e[0]-r[0]>180?e[0]-=360:r[0]-e[0]>180&&(e[0]+=360),e):e}),En=({coordinate:t})=>{const[e,n]=t;return[Math.max(-180,Math.min(180,e)),Math.max(-90,Math.min(90,n))]},Cn=({h3Index:t,properties:e})=>(void 0===e&&(e={}),{type:"Feature",id:t,properties:e,geometry:{type:"Polygon",coordinates:[N(t)]}}),In=({squareMeters:t})=>t/1852/1852,xn=({hexagons:t,getProperties:e})=>{const n=[];for(let r=0;r<t.length;r++){const i=t[r],A=e?.(i)||{};n.push(Cn({h3Index:i,properties:A}))}return{type:"FeatureCollection",features:n}},Sn=({hexagons:t=[],scale:e=1})=>{if(!t||!t?.length)return;const n=t.reduce((t,e)=>(t[e.hexId]=e,t),{}),r=xn({hexagons:t.map(({hexId:t})=>t),getProperties:t=>n[t]}).features.map(t=>{const n=Lt(ut(t.geometry.coordinates),e);return{...t,geometry:n.geometry}});return{type:"FeatureCollection",features:r}},Nn=({hexagons:t})=>{if(!Array.isArray(t)||!t.length)return{};const e=new Map;return t.forEach(t=>{const{hexId:n,sev:r,alt:i,observationTime:A}=t,o=e.get(n);!o||o.sev<r?e.set(n,{hexId:n,sev:r,alt:i,observationTime:A,reports:[...o?.reports||[],t]}):e.set(n,{...o,reports:[...o.reports,t]})}),Object.fromEntries(e)},Dn=({coordinate:t})=>t?.reverse(),Ln=({mapBounds:t,resolution:e=0})=>{const n=cn(t).geometry.coordinates.map(t=>t.map(t=>Dn({coordinate:t})));return T(n,e)},Tn=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{historyHours:n=B.HOURS_AGO,minAltitude:r=B.ALT_FROM,maxAltitude:i=B.ALT_TO,minSeverity:A=B.SEVERITY}=e,o=Object.entries(t).map(([t,e])=>[t,e.filter(({alt:t})=>t>=r&&t<=i).filter(({sev:t})=>t>=A).filter(({observationTime:t})=>it().unix()-t<=3600*n)]).filter(([,t])=>t.length>0);return Object.fromEntries(o)},Mn=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{minAltitude:n=B.ALT_FROM,maxAltitude:r=B.ALT_TO,minSeverity:i=B.SEVERITY,hoursAgo:A=B.HOURS_AGO,polygonSize:o=O.SMALL}=e,s=new Set,a=o===O.SMALL,u=it().unix()-3600*Number(A),c=Object.entries(t).map(([t,e])=>{const A=e.filter(({hexId:e,alt:A,sev:o,observationTime:c,sources:l})=>{if(A<n||A>r)return!1;if(o<i)return!1;if(0===o&&!a)return!1;if(!(1===l.length&&0===l[0])&&c<u)return!1;const f=`${L(e,t,5)}-${A}`;return!s.has(f)&&(s.add(f),!0)});return[t,A]}).filter(([,t])=>t.length>0);return Object.fromEntries(c)},On=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap(([t,n])=>Array.isArray(n)?n.map(({hexId:n,...r})=>({hexId:L(n,t,e),...r})):null).filter(Boolean)},Pn={0:700,1:300},Rn=({polygon:t,resolution:e,extensionFactor:n=1})=>{const r=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var A=[];switch(t.type){case"GeometryCollection":return Et(t,function(t){var n=tn(t,e,r,i);n&&A.push(n)}),ct(A);case"FeatureCollection":return wt(t,function(t){var n=tn(t,e,r,i);n&&wt(n,function(t){t&&A.push(t)})}),ct(A)}return tn(t,e,r,i)}(ut([t]),Pn[e]*n,{units:"kilometers"});return r.geometry.coordinates[0]},kn=25e5,Bn=({polygon:t})=>{const e=on(ut([t]));if(In({squareMeters:e})>kn)throw new Error("Corridor area is too large, maximum allowed area is 2500000 nautical miles")},Fn=({polygon:t,precision:e=1})=>{const n=ut([t]);return Number(Math.log2(360/(Ct(n)[2]-Ct(n)[0])).toFixed(e))},Gn=({polygon:t,mapping:e=P})=>{const n=Fn({polygon:t});return Object.entries(e).find(([,t])=>n<=t)[0]},Un=({deg:t})=>t*Math.PI/180,Qn=({rad:t})=>180*t/Math.PI,zn=({bbox:t})=>{const e=6378137,[n,r,i,A]=t,o=Un({deg:n}),s=Un({deg:r}),a=Un({deg:i}),u=Un({deg:A}),c=e*o,l=e*a,f=(e*Math.log(Math.tan(Math.PI/4+s/2))+e*Math.log(Math.tan(Math.PI/4+u/2)))/2,h=(c+l)/2/e,p=2*Math.atan(Math.exp(f/e))-Math.PI/2;return[Qn({rad:h}),Qn({rad:p})]},qn=({polygon:t,resolution:e,extensionFactor:n})=>{const r=Ct(ut([t])),i=cn(Ct(at(zn({bbox:r})))).geometry.coordinates[0];return Rn({polygon:i,resolution:e,extensionFactor:n})};var Vn=Object.freeze({__proto__:null,CORRIDOR_POLYGON_MAX_AREA_NM:kn,HEX_RESOLUTION_BUFFERS:Pn,adjustAntiMeridianCrossing:bn,adjustFeatureCoordinates:({coordinates:t})=>bn({coordinates:t}).map(t=>En({coordinate:t})),clampCoordinates:En,extendPolygonByResolution:Rn,getHexIdsByMapBoundsAndResolution:Ln,getHexIdsByPolygonAndResolution:({polygon:t,resolution:e=0,shouldInvertLatLng:n=!0})=>{const r=t.map(t=>n?Dn({coordinate:t}):t);return T(r,e)},getHexIdsFromMapboxMap:({map:t,resolution:e})=>{if(!t)return;const n=t.getBounds().toArray().flat();return Ln({mapBounds:n,resolution:e})},getHexagonsDataSlice:Tn,getHexagonsFeatureCollection:Sn,getMapPolygon:({map:t})=>{const e=t.getBounds().toArray().flat(),[n,r,i,A]=e;return[[n,A],[n,r],[i,r],[i,A],[n,A]]},getMercatorCenterFromBbox:zn,getMiddleArea:qn,getOneLayerHexagonsDataSlice:Mn,getPolygonSize:Gn,getZoomLevel:Fn,groupByHexIdAndSelectMostSevere:Nn,h3SetToFeatureCollection:xn,h3ToFeature:Cn,invertLatLng:Dn,normalizeAntiMeridian:wn,prepareHexagonsDataForMapHexagons:On,squareMetersToNauticalMiles:In,validateCorridorArea:Bn});const Yn={availableConfigInputs:{aircraftCategory:G,hours:{halfAnHour:"0.5",oneHour:"1",twoHours:"2",threeHours:"3",fourHours:"4"},severity:{smooth:0,light:1,lightModerate:2,moderate:3,moderateSevere:4},maxAltitude:k,minAltitude:R,largePolygonHandlingBehavior:{IGNORE:"ignore",USE_MIDDLE_AREA:"loadMiddleArea",EXCLUDE_SMOOTH_SEVERITY:"excludeSmoothSeverity"}}},jn=[0,1,2,3,4],Hn=Array.from({length:25},(t,e)=>e),Xn={INFO:"/weather/v5/nowcasting/info",DATA:"/weather/v6/nowcasting/{res}/{hexId}"},Wn={INFO:"/weather/v5/gtg/info",DATA:"/weather/v6/gtg/{res}/{hexId}"},$n="polygon",Kn="isCorridorMode",Jn="isEnabled",Zn=({response:t,lastUpdatedAt:e,parentCell:n})=>{const r=[];return(t?.data?.items||[]).forEach(t=>{const{forecast:n,alt:i,sev:A,edr:o,hexIds:s}=t,a=(t=>Array.isArray(t)?t.flatMap(t=>{if("number"==typeof t)return t;if(Array.isArray(t)&&2===t.length){const[e,n]=t;return Number.isInteger(e)&&Number.isInteger(n)&&e<=n?Array.from({length:n-e+1},(t,n)=>e+n):[]}return[]}):[])(s),u=it.unix(e).startOf("hour").add(n,"hour").unix(),c={hexIds:a,forecast:n,alt:i,sev:void 0!==o&&void 0===A?tt({edrValue:o}):A,observationTime:u,edr:o};r.push(c)}),{parentCell:n,reports:r}},tr=({data:t,resolution:e=5})=>t?Object.entries(t).flatMap(([t,n])=>n.flatMap(({hexIds:n,...r})=>n.map(n=>{let i;try{i=L(n,t,e)}catch(r){return console.warn(`[SkyPath SDK]: Hexagon skipped; ${r?.message||"Error while converting hexId to cellHexId"}`,{hexId:n,cell:t,resolution:e}),null}return{hexId:i,...r}})).filter(Boolean)):[],er=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?tr({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=tr({data:t});return Sn({hexagons:e})}}),nr="GET",rr="POST",ir="x-api-key",Ar="x-access-token",or="content-type",sr="/auth/v5/partner/login",ar="/auth/v5/partner/login-signed",ur="/auth/v5/partner/refresh-token",cr="/auth/v5/users/me",lr="/auth/v5/config/me",fr="[SkyPath SDK]: Old fetch request aborted",hr="local",pr="development",dr="staging",gr="production",yr={[hr]:"https://staging-api.skypath.io",[pr]:"https://dev-api.skypath.io",[dr]:"https://staging-api.skypath.io",[gr]:"https://api.skypath.io"},_r="ONELAYER_WEB-IS_ENABLED",mr="WEB_FORECAST-IS_ENABLED",vr="GTG-IS_ENABLED",br={CHROME:"Failed to fetch",FIREFOX:"NetworkError when attempting to fetch resource.",SAFARI:"Load failed"},wr={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Er=console,Cr={};Object.keys(wr).forEach(t=>{Cr[t]=Er[t]});const Ir="Datadog Browser SDK:",xr={debug:Cr.debug.bind(Er,Ir),log:Cr.log.bind(Er,Ir),info:Cr.info.bind(Er,Ir),warn:Cr.warn.bind(Er,Ir),error:Cr.error.bind(Er,Ir)},Sr="https://docs.datadoghq.com",Nr=`${Sr}/real_user_monitoring/browser/troubleshooting`,Dr="More details:";function Lr(t,e){return(...n)=>{try{return t(...n)}catch(t){xr.error(e,t)}}}function Tr(t){return 0!==t&&100*Math.random()<=t}function Mr(t,e){return Object.keys(t).some(n=>t[n]===e)}function Or(t){return 0===Object.keys(t).length}function Pr(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}const Rr=Pr(),kr="WorkerGlobalScope"in Rr;function Br(t,e){const n=Pr();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let Fr,Gr=!1;function Ur(t){Gr=t}function Qr(t){return function(...e){return zr(t,this,e)}}function zr(t,e,n){try{return t.apply(e,n)}catch(t){qr(t)}}function qr(t){if(Vr(t),Fr)try{Fr(t)}catch(t){Vr(t)}}function Vr(...t){Gr&&xr.error("[MONITOR]",...t)}function Yr(t,e){return Br(Pr(),"setTimeout")(Qr(t),e)}function jr(t){Br(Pr(),"clearTimeout")(t)}function Hr(t,e){return Br(Pr(),"setInterval")(Qr(t),e)}function Xr(t){Br(Pr(),"clearInterval")(t)}function Wr(t){var e;const n=null===(e=Rr.queueMicrotask)||void 0===e?void 0:e.bind(Rr);"function"==typeof n?n(Qr(t)):Promise.resolve().then(Qr(t))}class $r{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(e=>e(t))}addObserver(t){this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(e=>t!==e),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function Kr(...t){return new $r(e=>{const n=t.map(t=>t.subscribe(t=>e.notify(t)));return()=>n.forEach(t=>t.unsubscribe())})}class Jr extends $r{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let e=!1;const n={unsubscribe:()=>{e=!0,this.removeObserver(t)}};return Wr(()=>{for(const n of this.buffer){if(e)return;t(n)}e||this.addObserver(t)}),n}unbuffer(){Wr(()=>{this.maxBufferSize=this.buffer.length=0})}}const Zr=1e3,ti=6e4;function ei(){return(new Date).getTime()}function ni(){return ei()}function ri(){return performance.now()}function ii(){return{relative:ri(),timeStamp:ni()}}function Ai(t,e){return e-t}let oi;function si(){var t,e;return void 0===oi&&(oi=null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:performance.timeOrigin),oi}function ai(){}function ui(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ui)}const ci=/([\w-]+)\s*=\s*([^;]+)/g;function li(t,e,n=""){const r=t.charCodeAt(e-1),i=r>=55296&&r<=56319?e+1:e;return t.length<=i?t:`${t.slice(0,i)}${n}`}function fi(){return 0===(null!=hi?hi:hi=function(t=window){var e;const n=t.navigator.userAgent;return t.chrome||/HeadlessChrome/.test(n)?0:0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}())}let hi,pi,di,gi;function yi(t){return _i(t,location.href).href}function _i(t,e){const{URL:n}=function(){if(!pi){let t,e;try{t=document.createElement("iframe"),t.style.display="none",document.body.appendChild(t),e=t.contentWindow}catch(t){e=Rr}pi={URL:e.URL},null==t||t.remove()}return pi}();try{return void 0!==e?new n(t,e):new n(t)}catch(t){throw new Error(`Failed to construct URL: ${String(t)}`)}}function mi(t,e,n=0,r){const i=new Date;i.setTime(i.getTime()+n);const A=`expires=${i.toUTCString()}`,o=r&&r.crossSite?"none":"strict",s=r&&r.domain?`;domain=${r.domain}`:"",a=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${A};path=/;samesite=${o}${s}${a}${u}`}function vi(t){return function(t,e){for(ci.lastIndex=0;;){const n=ci.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function bi(t){return function(t){const e=new Map;for(ci.lastIndex=0;;){const n=ci.exec(t);if(!n)break;{const t=n[1],r=n[2];e.has(t)?e.get(t).push(r):e.set(t,[r])}}return e}(document.cookie).get(t)||[]}function wi(t){return di||(di=function(t){const e=new Map;for(ci.lastIndex=0;;){const n=ci.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),di.get(t)}function Ei(t,e){mi(t,"",0,e)}function Ci(t=location.hostname,e=document.referrer){if(void 0===gi){const n=function(t,e){try{return t||_i(e).hostname}catch(t){}}(t,e);if(n){const t=`dd_site_test_${ui()}`,e="test",r=n.split(".");let i=r.pop();for(;r.length&&!vi(t);)i=`${r.pop()}.${i}`,mi(t,e,Zr,{domain:i});Ei(t,{domain:i}),gi=i}}return gi}const Ii="_dd_s";function xi(t){return Object.values(t)}const Si=144e5,Ni=9e5,Di="cookie",Li="local-storage",Ti=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Mi(t,e){const n={isExpired:"1"};return e.trackAnonymousUser&&(null==t?void 0:t.anonymousId)&&(n.anonymousId=null==t?void 0:t.anonymousId),n}function Oi(t){return Or(t)}function Pi(t){return!Oi(t)}function Ri(t){return void 0!==t.isExpired||!((void 0===(e=t).created||ei()-Number(e.created)<Si)&&(void 0===e.expire||ei()<Number(e.expire)));var e}function ki(t){t.expire=String(ei()+Ni)}function Bi(t){return(e=t,Object.entries(e)).map(([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`).join("&");var e}function Fi(t){const e={};return function(t){return!!t&&(-1!==t.indexOf("&")||Ti.test(t))}(t)&&t.split("&").forEach(t=>{const n=Ti.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}}),e}function Gi(t){const e=function(t){const e={};if(e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains){const t=Ci();if(!t)return;e.domain=t}return e}(t);return e&&function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${ui()}`,n="test";mi(e,n,ti,t);const r=vi(e)===n;return Ei(e,t),r}catch(t){return xr.error(t),!1}}(e)?{type:Di,cookieOptions:e}:void 0}function Ui(t,e){const n={isLockEnabled:fi(),persistSession:n=>Qi(e,t,n,Ni),retrieveSession:()=>zi(e,t),expireSession:n=>Qi(e,t,Mi(n,t),Si)};return function(t){if(!wi(Ii)){const e=wi("_dd"),n=wi("_dd_r"),r=wi("_dd_l"),i={};e&&(i.id=e),r&&/^[01]$/.test(r)&&(i.logs=r),n&&/^[012]$/.test(n)&&(i.rum=n),Pi(i)&&(ki(i),t.persistSession(i))}}(n),n}function Qi(t,e,n,r){let i=Bi(n);e.betaEncodeCookieOptions&&(i=Bi({...n,...Or(n)?{}:{c:qi(t)}})),mi(Ii,i,e.trackAnonymousUser?31536e6:r,t)}function zi(t,e){if(e.betaEncodeCookieOptions)return function(t){const e=bi(Ii),n=qi(t);let r;for(const t of e.reverse())if(r=Fi(t),r.c===n)break;return null==r||delete r.c,null!=r?r:{}}(t);return Fi(vi(Ii))}function qi(t){let e=0;return e|=0,e|=(t.domain?t.domain.split(".").length-1:0)<<1,e|=t.crossSite?1:0,e.toString(16)}function Vi(){try{const t=ui(),e=`_dd_test_${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:Li}:void 0}catch(t){return}}function Yi(t){return{isLockEnabled:!1,persistSession:ji,retrieveSession:Hi,expireSession:e=>function(t,e){ji(Mi(t,e))}(e,t)}}function ji(t){localStorage.setItem(Ii,Bi(t))}function Hi(){return Fi(localStorage.getItem(Ii))}const Xi="--",Wi=[];let $i;function Ki(t,e,n=0){var r;const{isLockEnabled:i,persistSession:A,expireSession:o}=e,s=t=>A({...t,lock:u}),a=()=>{const{lock:t,...n}=e.retrieveSession();return{session:n,lock:t&&!tA(t)?t:void 0}};if($i||($i=t),t!==$i)return void Wi.push(t);if(i&&n>=100)return void Zi(e);let u,c=a();if(i){if(c.lock)return void Ji(t,e,n);if(u=ui()+Xi+ni(),s(c.session),c=a(),c.lock!==u)return void Ji(t,e,n)}let l=t.process(c.session);if(i&&(c=a(),c.lock!==u))Ji(t,e,n);else{if(l&&(Ri(l)?o(l):(ki(l),i?s(l):A(l))),i&&(!l||!Ri(l))){if(c=a(),c.lock!==u)return void Ji(t,e,n);A(c.session),l=c.session}null===(r=t.after)||void 0===r||r.call(t,l||c.session),Zi(e)}}function Ji(t,e,n){Yr(()=>{Ki(t,e,n+1)},10)}function Zi(t){$i=void 0;const e=Wi.shift();e&&Ki(e,t)}function tA(t){const[,e]=t.split(Xi);return!e||Ai(Number(e),ni())>1e3}const eA=Zr;function nA(t){switch(t.sessionPersistence){case Di:return Gi(t);case Li:return Vi();case void 0:{let e=Gi(t);return!e&&t.allowFallbackToLocalStorage&&(e=Vi()),e}default:xr.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function rA(t,e,n,r,i=function(t,e){return t.type===Di?Ui(e,t.cookieOptions):Yi(e)}(t,e)){const A=new $r,o=new $r,s=new $r,a=Hr(function(){const t=i.retrieveSession();Ri(t)?Ki({process:t=>Ri(t)?Mi(t,e):void 0,after:f},i):f(t)},eA);let u;h();const{throttled:c,cancel:l}=function(t,e){let n,r,i=!1;return{throttled:(...A)=>{i?n=A:(t(...A),i=!0,r=Yr(()=>{n&&t(...n),i=!1,n=void 0},e))},cancel:()=>{jr(r),i=!1,n=void 0}}}(()=>{Ki({process:t=>{if(Oi(t))return;const e=f(t);return function(t){if(Oi(t))return!1;const e=r(t[n]);t[n]=e,delete t.isExpired,"0"===e||t.id||(t.id=ui(),t.created=String(ei()))}(e),e},after:t=>{Pi(t)&&!p()&&function(t){u=t,A.notify()}(t),u=t}},i)},eA);function f(t){return Ri(t)&&(t=Mi(t,e)),p()&&(!function(t){return u.id!==t.id||u[n]!==t[n]}(t)?(s.notify({previousState:u,newState:t}),u=t):(u=Mi(u,e),o.notify())),t}function h(){Ki({process:t=>{if(Oi(t))return t.anonymousId=ui(),Mi(t,e)},after:t=>{u=t}},i)}function p(){return void 0!==(null==u?void 0:u[n])}return{expandOrRenewSession:c,expandSession:function(){Ki({process:t=>p()?f(t):void 0},i)},getSession:()=>u,renewObservable:A,expireObservable:o,sessionStateUpdateObservable:s,restartSession:h,expire:t=>{l(),!1===t&&u&&delete u.anonymousId,i.expireSession(u),f(Mi(u,e))},stop:()=>{Xr(a)},updateSessionState:function(t){Ki({process:e=>({...e,...t}),after:f},i)}}}const iA={GRANTED:"granted",NOT_GRANTED:"not-granted"};function AA(t){return null===t?"null":Array.isArray(t)?"array":typeof t}const oA=["chrome-extension://","moz-extension://"];function sA(t){return oA.some(e=>t.includes(e))}function aA(t,e,n=("undefined"!=typeof location?location.origin:"")){const r=t.allowedTrackingOrigins;if(!r)return!function(t,e=""){return!sA(t)&&sA(e.split("\n").filter(t=>{const e=t.trim();return e.length&&/^at\s+|@/.test(e)})[1]||"")}(n,e)||(xr.error("Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided."),!1);const i=function(t,e,n=!1){return t.some(t=>{try{if("function"==typeof t)return t(e);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?e.startsWith(t):t===e}catch(t){xr.error(t)}return!1})}(r,n);return i||xr.error("SDK initialized on a non-allowed domain."),i}const uA="datad0g.com",cA="dd0g-gov.com",lA="datadoghq.com",fA="pci.browser-intake-datadoghq.com",hA=["ddsource","dd-api-key","dd-request-id"];function pA(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=yi(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const i=function(t,e){const{site:n=lA,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===lA)return fA;if(r&&n===lA)return`${r}.${lA}`;if(n===cA)return`http-intake.logs.${n}`;const i=n.split("."),A=i.pop();return`browser-intake-${i.join("-")}.${A}`}(e,t);return t=>`https://${i}${n}?${t}`}(t,e);return{build(i,A){const o=function({clientToken:t,internalAnalyticsSubdomain:e,source:n="browser"},r,i,{retry:A,encoding:o},s=[]){const a=[`ddsource=${n}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.25.0")}`,"dd-evp-origin=browser",`dd-request-id=${ui()}`].concat(s);o&&a.push(`dd-evp-encoding=${o}`);"rum"===r&&(a.push(`batch_time=${ni()}`,`_dd.api=${i}`),A&&a.push(`_dd.retry_count=${A.count}`,`_dd.retry_after=${A.lastFailureStatus}`));e&&a.reverse();return a.join("&")}(t,e,i,A,n);return r(o)},trackType:e}}function dA(t){const e=t.site||lA,n=function(t){if("flutter"===t||"unity"===t)return t;return"browser"}(t.source),r=function(t){return{logsEndpointBuilder:pA(t,"logs"),rumEndpointBuilder:pA(t,"rum"),profilingEndpointBuilder:pA(t,"profile"),sessionReplayEndpointBuilder:pA(t,"replay"),exposuresEndpointBuilder:pA(t,"exposures"),flagEvaluationEndpointBuilder:pA(t,"flagevaluation")}}({...t,site:e,source:n}),i=function(t){if(!t.replica)return;const e={...t,site:lA,clientToken:t.replica.clientToken};return{logsEndpointBuilder:pA(e,"logs"),rumEndpointBuilder:pA(e,"rum",[`application.id=${t.replica.applicationId}`])}}({...t,site:e,source:n});return{replica:i,site:e,source:n,...r}}function gA(t,e){return null==t||"string"==typeof t||(xr.error(`${e} must be defined as a string`),!1)}function yA(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(xr.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function _A(t,e){var n,r,i,A,o,s,a,u,c,l;if(t&&t.clientToken)if(void 0===t.allowedTrackingOrigins||Array.isArray(t.allowedTrackingOrigins)){if((!(f=t.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(xr.error(`Site should be a valid Datadog site. ${Dr} ${Sr}/getting_started/site/.`),0))&&yA(t.sessionSampleRate,"Session")&&yA(t.telemetrySampleRate,"Telemetry")&&yA(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&yA(t.telemetryUsageSampleRate,"Telemetry Usage")&&gA(t.version,"Version")&&gA(t.env,"Env")&&gA(t.service,"Service")&&aA(t,null!=e?e:"")){var f;if(void 0===t.trackingConsent||Mr(iA,t.trackingConsent))return{beforeSend:t.beforeSend&&Lr(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:kr?void 0:nA(t),sessionSampleRate:null!==(n=t.sessionSampleRate)&&void 0!==n?n:100,telemetrySampleRate:null!==(r=t.telemetrySampleRate)&&void 0!==r?r:20,telemetryConfigurationSampleRate:null!==(i=t.telemetryConfigurationSampleRate)&&void 0!==i?i:5,telemetryUsageSampleRate:null!==(A=t.telemetryUsageSampleRate)&&void 0!==A?A:5,service:null!==(o=t.service)&&void 0!==o?o:void 0,env:null!==(s=t.env)&&void 0!==s?s:void 0,version:null!==(a=t.version)&&void 0!==a?a:void 0,datacenter:null!==(u=t.datacenter)&&void 0!==u?u:void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(c=t.trackingConsent)&&void 0!==c?c:iA.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,betaEncodeCookieOptions:!!t.betaEncodeCookieOptions,variant:t.variant,sdkVersion:t.sdkVersion,...dA(t)};xr.error('Tracking Consent should be either "granted" or "not-granted"')}}else xr.error("Allowed Tracking Origins must be an array");else xr.error("Client Token is not configured, we will not send any data.")}var mA;!function(t){t.TRACK_INTAKE_REQUESTS="track_intake_requests",t.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",t.FEATURE_OPERATION_VITAL="feature_operation_vital",t.SHORT_SESSION_INVESTIGATION="short_session_investigation",t.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"}(mA||(mA={}));const vA=new Set;function bA(t){Array.isArray(t)&&t.filter(t=>Mr(mA,t)).forEach(t=>{vA.add(t)})}function wA(t){return vA.has(t)}function EA(){return vA}const CA="?";function IA(t){var e,n;const r=[];let i=PA(t,"stack");const A=String(t);if(i&&i.startsWith(A)&&(i=i.slice(A.length)),i&&i.split("\n").forEach(t=>{const e=function(t){const e=NA.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),i=DA.exec(e[2]);r&&i&&(e[2]=i[1],e[3]=i[2],e[4]=i[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||CA,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=LA.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:CA,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=TA.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||CA,line:+e[3],url:e[2]}}(t)||function(t){const e=MA.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=OA.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||CA,line:e[4]?+e[4]:void 0,url:e[3]}}(t);e&&(!e.func&&e.line&&(e.func=CA),r.push(e))}),r.length>0&&function(){if(void 0!==FA)return FA;class t extends Error{constructor(){super(),this.name="Error"}}const[e,n]=[t,Error].map(t=>new t);return FA=BA(Object.getPrototypeOf(e))&&n.stack!==e.stack,FA}()&&t instanceof Error){const i=[];let A=t;for(;(A=Object.getPrototypeOf(A))&&BA(A);){const t=(null===(e=A.constructor)||void 0===e?void 0:e.name)||CA;i.push(t)}for(let t=i.length-1;t>=0&&(null===(n=r[0])||void 0===n?void 0:n.func)===i[t];t--)r.shift()}return{message:PA(t,"message"),name:PA(t,"name"),stack:r}}const xA="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",SA="(?::(\\d+))",NA=new RegExp(`^\\s*at (.*?) ?\\(${xA}${SA}?${SA}?\\)?\\s*$`,"i"),DA=new RegExp(`\\((\\S*)${SA}${SA}\\)`);const LA=new RegExp(`^\\s*at ?${xA}${SA}?${SA}??\\s*$`,"i");const TA=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const MA=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,OA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function PA(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function RA(t,e,n,r){if(void 0===e)return;const{name:i,message:A}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=kA.exec(t));return{name:e,message:n}}(t);return{name:i,message:A,stack:[{url:e,column:r,line:n}]}}const kA=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function BA(t){return String(t.constructor).startsWith("class ")}let FA;function GA(t){const e=new Error(t);let n;return e.name="HandlingStack",zr(()=>{const t=IA(e);t.stack=t.stack.slice(2),n=UA(t)}),n}function UA(t){let e=QA(t);return t.stack.forEach(t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",i=t.line?`:${t.line}`:"",A=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${i}${A}`}),e}function QA(t){return`${t.name||"Error"}: ${t.message}`}function zA(t,e,n,{computeHandlingStack:r}={}){let i=t[e];if("function"!=typeof i){if(!(e in t)||"string"!=typeof e||!e.startsWith("on"))return{stop:ai};i=ai}let A=!1;const o=function(){if(A)return i.apply(this,arguments);const t=Array.from(arguments);let e;zr(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?GA("instrumented method"):void 0}]);const o=i.apply(this,t);return e&&zr(e,null,[o]),o};return t[e]=o,{stop:()=>{A=!0,t[e]===o&&(t[e]=i)}}}const qA=/[^\u0000-\u007F]/;function VA(t){return qA.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function YA(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=jA(Object.prototype),i=jA(Array.prototype),A=jA(Object.getPrototypeOf(t)),o=jA(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),i(),A(),o()}}function jA(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):ai}function HA(t,e=225280){const n=jA(Object.prototype),r=jA(Array.prototype),i=[],A=new WeakMap,o=XA(t,"$",void 0,i,A),s=JSON.stringify(o);let a=s?s.length:0;if(!(a>e)){for(;i.length>0&&a<e;){const n=i.shift();let r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){const s=XA(n.source[o],n.path,o,i,A);if(a+=void 0!==s?JSON.stringify(s).length:4,a+=r,r=1,a>e){$A(e,"truncated",t);break}n.target[o]=s}else for(const o in n.source)if(Object.prototype.hasOwnProperty.call(n.source,o)){const s=XA(n.source[o],n.path,o,i,A);if(void 0!==s&&(a+=JSON.stringify(s).length+r+o.length+3,r=1),a>e){$A(e,"truncated",t);break}n.target[o]=s}}return n(),r(),o}$A(e,"discarded",t)}function XA(t,e,n,r,i){const A=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!A||"object"!=typeof A)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(A);const o=WA(A);if("[Object]"!==o&&"[Array]"!==o&&"[Error]"!==o)return o;const s=t;if(i.has(s))return`[Reference seen at ${i.get(s)}]`;const a=void 0!==n?`${e}.${n}`:e,u=Array.isArray(A)?[]:{};return i.set(s,a),r.push({source:A,target:u,path:a}),u}function WA(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?WA(e.currentTarget):null,target:e.target?WA(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function $A(t,e,n){xr.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const KA="No stack, consider using an instance of Error";function JA({originalError:t,stackTrace:e,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){const A=ro(t);return!e&&A&&(e=IA(t)),{source:n,type:e?e.name:void 0,message:to(e,A,i,t),stack:e?UA(e):r?KA:void 0}}function ZA({stackTrace:t,originalError:e,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:A,useFallbackStack:o=!0,source:s,handling:a}){return{startClocks:i,handling:a,handlingStack:n,componentStack:r,originalError:e,...JA({originalError:e,stackTrace:t,source:s,useFallbackStack:o,nonErrorPrefix:A}),causes:ro(e)?io(e,s):void 0,fingerprint:eo(e),context:no(e)}}function to(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":n?`${n} ${YA(HA(r))}`:YA(HA(r))}function eo(t){return ro(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function no(t){if(null!==t&&"object"==typeof t&&"dd_context"in t)return t.dd_context}function ro(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function io(t,e){const n=[];let r=t.cause;for(;null!=r&&n.length<10;){const t=JA({originalError:r,source:e,useFallbackStack:!1});n.push(t),r=ro(r)?r.cause:void 0}return n.length?n:void 0}const Ao="agent",oo="console",so="logger",ao="network",uo="source",co="report";function lo(){return new $r(t=>{const e=(e,n)=>{const r=ZA({stackTrace:n,originalError:e,startClocks:ii(),nonErrorPrefix:"Uncaught",source:uo,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,zA(Pr(),"onerror",({parameters:[t,e,n,i,A]})=>{let o;ro(A)||(o=RA(t,e,n,i)),r(null!=A?A:t,o)}));var r;const{stop:i}=function(t){return zA(Pr(),"onunhandledrejection",({parameters:[e]})=>{t(e.reason||"Empty reason")})}(e);return()=>{n(),i()}})}function fo(t,e){e.silentMultipleInit||xr.error(`${t} is already initialized.`)}function ho(t,e,n,r,i){return po(t,e,[n],r,i)}function po(t,e,n,r,{once:i,capture:A,passive:o}={}){const s=Qr(e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(i&&l(),r(e))}),a=o?{capture:A,passive:o}:A,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,c=Br(u,"addEventListener");function l(){const t=Br(u,"removeEventListener");n.forEach(n=>t.call(e,n,s,a))}return n.forEach(t=>c.call(e,t,s,a)),{stop:l}}const go={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function yo(t,e){const n=[];e.includes(go.cspViolation)&&n.push(function(t){return new $r(e=>{const{stop:n}=ho(t,document,"securitypolicyviolation",t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return _o({type:t.effectiveDirective,message:`${go.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:mo(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${li(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))});return n})}(t));const r=e.filter(t=>t!==go.cspViolation);return r.length&&n.push(function(t){return new $r(e=>{if(!window.ReportingObserver)return;const n=Qr((t,n)=>t.forEach(t=>e.notify(function(t){const{type:e,body:n}=t;return _o({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:mo(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}})}(r)),Kr(...n)}function _o(t){return{startClocks:ii(),source:co,handling:"unhandled",...t}}function mo(t,e,n,r,i){return n?UA({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=i?i:void 0}]}):void 0}function vo(t){const{env:e,service:n,version:r,datacenter:i,sdkVersion:A,variant:o}=t,s=[bo("sdk_version",null!=A?A:"6.25.0")];return e&&s.push(bo("env",e)),n&&s.push(bo("service",n)),r&&s.push(bo("version",r)),i&&s.push(bo("datacenter",i)),o&&s.push(bo("variant",o)),s}function bo(t,e){const n=e?`${t}:${e}`:t;return(n.length>200||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(n))&&xr.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${Dr} ${Sr}/getting_started/tagging/#defining-tags`),wo(n)}function wo(t){return t.replace(/,/g,"_")}function Eo(t,e){const n=Rr.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function Co(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=Co(r[t],e[t],n);return r}const r="object"===AA(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=Co(r[t],e[t],n));return r}function Io(t){return Co(void 0,t)}function xo(...t){let e;for(const n of t)null!=n&&(e=Co(e,n));return e}function So(){var t;const e=Rr.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function No(t){return t>=500}const Do=20971520,Lo=Zr;function To(t,e,n,r,i,A){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Oo(t,e,n,A,{onSuccess:()=>Po(0,e,n,r,i,A),onFailure:()=>{e.queuedPayloads.enqueue(t)||A.notify({type:"queue-full",bandwidth:e.bandwidthMonitor.stats(),payload:t}),Mo(e,n,r,i,A)}}):e.queuedPayloads.enqueue(t)||A.notify({type:"queue-full",bandwidth:e.bandwidthMonitor.stats(),payload:t})}function Mo(t,e,n,r,i){2===t.transportStatus&&Yr(()=>{Oo(t.queuedPayloads.first(),t,e,i,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=Lo,Po(1,t,e,n,r,i)},onFailure:()=>{t.currentBackoffTime=Math.min(6e4,2*t.currentBackoffTime),Mo(t,e,n,r,i)}})},t.currentBackoffTime)}function Oo(t,e,n,r,{onSuccess:i,onFailure:A}){e.bandwidthMonitor.add(t),n(t,n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||No(t.status))}(n)?(e.transportStatus=0,r.notify({type:"success",bandwidth:e.bandwidthMonitor.stats(),payload:t}),i()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},r.notify({type:"failure",bandwidth:e.bandwidthMonitor.stats(),payload:t}),A())})}function Po(t,e,n,r,i,A){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: 20MiB`,source:Ao,startClocks:ii()}),e.queueFullReported=!0);const o=e.queuedPayloads;for(e.queuedPayloads=Ro();o.size()>0;)To(o.dequeue(),e,n,r,i,A)}function Ro(){const t=[];return{bytesCount:0,enqueue(e){return!this.isFull()&&(t.push(e),this.bytesCount+=e.bytesCount,!0)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=Do}}}const ko=16384;function Bo(t,e,n=16384){const r=new $r,i={transportStatus:0,currentBackoffTime:Lo,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=81920&&this.ongoingRequestCount<32},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}},queuedPayloads:Ro(),queueFullReported:!1};return{observable:r,send:A=>{for(const o of t)To(A,i,(t,e)=>{wA(mA.AVOID_FETCH_KEEPALIVE)?Qo(o,t,e):Uo(o,n,t,e)},o.trackType,e,r)},sendOnExit:e=>{for(const r of t)Fo(r,n,e)}}}function Fo(t,e,n){if(!!navigator.sendBeacon&&n.bytesCount<e)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Go||(Go=!0,qr(t))}(t)}Qo(t,n)}let Go=!1;function Uo(t,e,n,r){if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e){const e=t.build("fetch-keepalive",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(Qr(t=>null==r?void 0:r({status:t.status,type:t.type}))).catch(Qr(()=>Qo(t,n,r)))}else Qo(t,n,r)}function Qo(t,e,n){const r=t.build("fetch",e);fetch(r,{method:"POST",body:e.data,mode:"cors"}).then(Qr(t=>null==n?void 0:n({status:t.status,type:t.type}))).catch(Qr(()=>null==n?void 0:n({status:0})))}function zo(){const t=Pr().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const i=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:i}))}}}function qo(t){var e;void 0===t&&(t=null===(e=Pr().location)||void 0===e?void 0:e.hostname);const n=zo();return!!n&&n.getAllowedWebViewHosts().some(e=>t===e||t.endsWith(`.${e}`))}const Vo={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};const Yo=262144;function jo({encoder:t,request:e,flushController:n}){let r={};const i=n.flushObservable.subscribe(n=>function(n){const i=xi(r).join("\n");r={};const A=(s=n.reason,xi(Vo).includes(s)),o=A?e.sendOnExit:e.send;var s;if(A&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&o(Ho(e));const n=[e.pendingData,i].filter(Boolean).join("\n");n&&o({data:n,bytesCount:VA(n)})}else i&&t.write(t.isEmpty?i:`\n${i}`),t.finish(t=>{o(Ho(t))})}(n));function A(e,i){const A=YA(e),o=t.estimateEncodedBytesCount(A);o>=Yo?xr.warn(`Discarded a message whose size was bigger than the maximum allowed size 256KiB. ${Dr} ${Nr}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==r[t]}(i)&&function(e){const i=r[e];delete r[e];const A=t.estimateEncodedBytesCount(i);n.notifyAfterRemoveMessage(A)}(i),function(e,i,A){n.notifyBeforeAddMessage(i),void 0!==A?(r[A]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,t=>{n.notifyAfterAddMessage(t-i)})}(A,o,i))}return{flushController:n,add:A,upsert:A,stop:i.unsubscribe}}function Ho(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}const Xo=kr?1:50;function Wo({pageMayExitObservable:t,sessionExpireObservable:e}){const n=t.subscribe(t=>a(t.reason)),r=e.subscribe(()=>a("session_expire")),i=new $r(()=>()=>{n.unsubscribe(),r.unsubscribe()});let A,o=0,s=0;function a(t){if(0===s)return;const e=s,n=o;s=0,o=0,u(),i.notify({reason:t,messagesCount:e,bytesCount:n})}function u(){jr(A),A=void 0}return{flushObservable:i,get messagesCount(){return s},notifyBeforeAddMessage(t){o+t>=ko&&a("bytes_limit"),s+=1,o+=t,void 0===A&&(A=Yr(()=>{a("duration_limit")},3e4))},notifyAfterAddMessage(t=0){o+=t,s>=Xo?a("messages_limit"):o>=ko&&a("bytes_limit")},notifyAfterRemoveMessage(t){o-=t,s-=1,0===s&&u()}}}const $o="DISCARDED",Ko="SKIPPED";const Jo="log",Zo="configuration",ts="usage",es=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],ns=["ddog-gov.com"];let rs;function is(){return rs||(rs=new Jr(100)),rs}function As(t,e,n,r,i,A){const o=new $r,{stop:s}=function(t,e,n,r,i){const A=[];if(qo()){const t=zo(),e=i.subscribe(e=>t.send("internal_telemetry",e));A.push(e.unsubscribe)}else{const o=[t.rumEndpointBuilder];t.replica&&function(t){return t.site===uA}(t)&&o.push(t.replica.rumEndpointBuilder);const s=jo({encoder:r(4),request:Bo(o,e),flushController:Wo({pageMayExitObservable:n,sessionExpireObservable:new $r})});A.push(s.stop);const a=i.subscribe(s.add);A.push(a.unsubscribe)}return{stop:()=>A.forEach(t=>t())}}(e,r,i,A,o),{enabled:a,metricsEnabled:u}=function(t,e,n,r,i=1,A=15){const o={},s=!ns.includes(e.site)&&Tr(e.telemetrySampleRate),a={[Jo]:s,[Zo]:s&&Tr(e.telemetryConfigurationSampleRate),[ts]:s&&Tr(e.telemetryUsageSampleRate),metric:s&&Tr(i)},u={is_local_file:"file:"===(null===(l=Rr.location)||void 0===l?void 0:l.protocol),is_worker:kr},c=is();var l;return c.subscribe(({rawEvent:e,metricName:i})=>{if(i&&!a.metric||!a[e.type])return;const s=i||e.status||e.type;let c=o[s];if(c||(c=o[s]=new Set),c.size>=A)return;const l=YA(e);if(c.has(l))return;const h=n.triggerHook(1,{startTime:ii().relative});if(h===$o)return;const p=f(h,t,e,u);r.notify(p),Eo("telemetry",p),c.add(l)}),c.unbuffer(),function(t){Fr=t}(ss),{enabled:s,metricsEnabled:a.metric};function f(t,n,r,i){const A={type:"telemetry",date:ii().timeStamp,service:n,version:"6.25.0",source:"browser",_dd:{format_version:2},telemetry:xo(r,{runtime_env:i,connectivity:So(),sdk_setup:"npm"}),ddtags:vo(e).join(","),experimental_features:Array.from(EA())};return xo(A,t)}}(t,e,n,o);return{stop:s,enabled:a,metricsEnabled:u}}function os(t,e){Vr(wr.debug,t,e),is().notify({rawEvent:{type:Jo,message:t,status:"debug",...e}})}function ss(t,e){is().notify({rawEvent:{type:Jo,status:"error",...as(t),...e}})}function as(t){if(ro(t)){const e=IA(t);return{error:{kind:e.name,stack:UA(us(e))},message:e.message}}return{error:{stack:KA},message:`Uncaught ${YA(t)}`}}function us(t){return t.stack=t.stack.filter(t=>!t.url||es.some(e=>t.url.startsWith(e))),t}function cs(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const ls=1/0;let fs=null;const hs=new Set;function ps({expireDelay:t,maxEntries:e}){let n=[];fs||(fs=Hr(()=>{hs.forEach(t=>t())},6e4));const r=()=>{const e=ri()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()};return hs.add(r),{add:function(t,r){const i={value:t,startTime:r,endTime:ls,remove:()=>{cs(n,i)},close:t=>{i.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(i),i},find:function(t=Infinity,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===ls&&e.close(t)},findAll:function(t=Infinity,e=0){const r=t+e;return n.filter(e=>e.startTime<=r&&t<=e.endTime).map(t=>t.value)},reset:function(){n=[]},stop:function(){hs.delete(r),0===hs.size&&fs&&(Xr(fs),fs=null)}}}function ds(){return!kr&&Boolean(Rr._DATADOG_SYNTHETICS_INJECTS_RUM||wi("datadog-synthetics-injects-rum"))}function gs(){return Boolean(function(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||wi("datadog-synthetics-public-id");return"string"==typeof t?t:void 0}()&&function(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||wi("datadog-synthetics-result-id");return"string"==typeof t?t:void 0}())}const ys=ti,_s=Si;function ms(t,e,n,r){const i=new $r,A=new $r,o=rA(t.sessionStoreStrategyType,t,e,n),s=ps({expireDelay:_s});if(o.renewObservable.subscribe(()=>{s.add(a(),ri()),i.notify()}),o.expireObservable.subscribe(()=>{A.notify(),s.closeActive(ri())}),o.expandOrRenewSession(),s.add(a(),[0,si()][0]),wA(mA.SHORT_SESSION_INVESTIGATION)){const e=o.getSession();e&&function(t,e){if(!window.cookieStore||!e.created)return;const n=Number(e.created),r=ei(),{stop:i}=ho(t,cookieStore,"change",A);function A(t){const A=function(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(e(r,n,t))return r}}(t.changed,t=>t.name===Ii);if(!A)return;const o=ei()-n;if(o>84e4)i();else{const t=Fi(A.value);if(t.id&&t.id!==e.id){i();const n=ei()-r;vs().then(r=>{os("Session cookie changed",{time:n,session_age:o,old:e,new:t,cookie:r})}).catch(qr)}}}}(t,e)}function a(){const n=o.getSession();return n?{id:n.id,trackingType:n[e],isReplayForced:!!n.forcedReplay,anonymousId:n.anonymousId}:(async function(t){const e=t.sessionStoreStrategyType;if(!e)return;let n,r;e.type===Di?(n=zi(e.cookieOptions,t),r={cookie:await vs(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=Hi();os("Unexpected session state",{sessionStoreStrategyType:e.type,session:n,isSyntheticsTest:gs(),createdTimestamp:null==n?void 0:n.created,expireTimestamp:null==n?void 0:n.expire,...r})}(t).catch(()=>{}),{id:"invalid",trackingType:"0",isReplayForced:!1,anonymousId:void 0})}return r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire(!1)}),function(t,e){const{stop:n}=po(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,()=>{r.isGranted()&&o.expandOrRenewSession()}),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=ho(t,document,"visibilitychange",n);Hr(n,ys)}(t,()=>o.expandSession()),function(t,e){const{stop:n}=ho(t,window,"resume",e,{capture:!0})}(t,()=>o.restartSession()),{findSession:(t,e)=>s.find(t,e),renewObservable:i,expireObservable:A,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}async function vs(){let t;return t="cookieStore"in window?await window.cookieStore.getAll(Ii):document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(Ii)),{count:t.length,domain:Ci()||"undefined",...t}}function bs(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const i=VA(n);e+=i,t+=n,r&&r(i)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}let ws;const Es=new WeakMap;function Cs(t){return ws||(ws=function(t){return new $r(e=>{const{stop:n}=zA(XMLHttpRequest.prototype,"open",Is),{stop:r}=zA(XMLHttpRequest.prototype,"send",n=>{!function({target:t,parameters:[e],handlingStack:n},r,i){const A=Es.get(t);if(!A)return;const o=A;o.state="start",o.startClocks=ii(),o.isAborted=!1,o.xhr=t,o.handlingStack=n,o.requestBody=e;let s=!1;const{stop:a}=zA(t,"onreadystatechange",()=>{t.readyState===XMLHttpRequest.DONE&&u()}),u=()=>{if(c(),a(),s)return;s=!0;const e=A;var n;e.state="complete",e.duration=Ai(o.startClocks.timeStamp,ni()),e.status=t.status,"string"==typeof t.response&&(e.responseBody=t.response),i.notify((n=e,{...n}))},{stop:c}=ho(r,t,"loadend",u);i.notify(o)}(n,t,e)},{computeHandlingStack:!0}),{stop:i}=zA(XMLHttpRequest.prototype,"abort",xs);return()=>{n(),r(),i()}})}(t)),ws}function Is({target:t,parameters:[e,n]}){Es.set(t,{state:"open",method:String(e).toUpperCase(),url:yi(String(n))})}function xs({target:t}){const e=Es.get(t);e&&(e.isAborted=!0)}async function Ss(t,e){const n=t.getReader(),r=[];for(;;){const t=await n.read();if(t.done)break;e.collectStreamBody&&r.push(t.value)}return n.cancel().catch(ai),e.collectStreamBody?function(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(r):void 0}let Ns;const Ds=[];function Ls({responseBodyAction:t}={}){return t&&Ds.push(t),Ns||(Ns=new $r(t=>{if(!Rr.fetch)return;const{stop:e}=zA(Rr,"fetch",e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[i,A]=t;let o=A&&A.method;void 0===o&&i instanceof Request&&(o=i.method);const s=void 0!==o?String(o).toUpperCase():"GET",a=i instanceof Request?i.url:yi(String(i)),u=ii(),c={state:"start",init:A,input:i,method:s,startClocks:u,url:a,handlingStack:n};r.notify(c),t[0]=c.input,t[1]=c.init,e(t=>{(async function(t,e,n){var r,i;const A=n;let o;A.state="resolve";try{o=await e}catch(e){return A.status=0,A.isAborted=(null===(i=null===(r=A.init)||void 0===r?void 0:r.signal)||void 0===i?void 0:i.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,A.error=e,void t.notify(A)}A.response=o,A.status=o.status,A.responseType=o.type,A.isAborted=!1;const s=Ds.reduce((t,e)=>Math.max(t,e(A)),0);if(0!==s){const t=function(t){try{return t.clone()}catch(t){return}}(o);if(t&&t.body)try{const e=await Ss(t.body,{collectStreamBody:2===s});A.responseBody=e&&(new TextDecoder).decode(e)}catch(t){}}t.notify(A)})(r,t,c).catch(qr)})}(e,t),{computeHandlingStack:!0});return e})),Ns}let Ts={};function Ms(t){return Kr(...t.map(t=>(Ts[t]||(Ts[t]=function(t){return new $r(e=>{const n=Er[t];return Er[t]=(...r)=>{n.apply(console,r);const i=GA("console error");zr(()=>{e.notify(function(t,e,n){const r=t.map(t=>function(t){if("string"==typeof t)return HA(t);if(ro(t))return QA(IA(t));return YA(HA(t),void 0,2)}(t)).join(" ");if(e===wr.error){const i=ZA({originalError:t.find(ro),handlingStack:n,startClocks:ii(),source:oo,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=r,{api:e,message:r,handlingStack:n,error:i}}return{api:e,message:r,error:void 0,handlingStack:n}}(r,t,i))})},()=>{Er[t]=n}})}(t)),Ts[t])))}function Os(t,e,n){const r={...t};for(const[t,{required:i,type:A}]of Object.entries(e))"string"!==A||Ps(r[t])||(r[t]=String(r[t])),i&&Ps(r[t])&&xr.warn(`The property ${t} of ${n} is required; context will not be sent to the intake.`);return r}function Ps(t){return null==t||""===t}function Rs(t="",{propertiesConfig:e={}}={}){let n={};const r=new $r,i={getContext:()=>Io(n),setContext:A=>{!function(t){const e="object"===AA(t);return e||xr.error("Unsupported context:",t),e}(A)?i.clearContext():n=HA(Os(A,e,t)),r.notify()},setContextProperty:(i,A)=>{n=HA(Os({...n,[i]:A},e,t)),r.notify()},removeContextProperty:i=>{delete n[i],Os(n,e,t),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function ks(t,e,n,r){return Qr((...r)=>t()[e][n](...r))}function Bs(t,e,n){t.changeObservable.subscribe(()=>{const r=t.getContext();n.add(t=>t[e].setContext(r))})}const Fs="_dd_c",Gs=[];function Us(t,e,n,r){const i=function(t,e){return`${Fs}_${t}_${e}`}(n,r);Gs.push(ho(t,window,"storage",({key:t})=>{i===t&&e.setContext(o())})),e.changeObservable.subscribe(function(){localStorage.setItem(i,JSON.stringify(e.getContext()))});const A=xo(o(),e.getContext());function o(){const t=localStorage.getItem(i);return t?JSON.parse(t):{}}Or(A)||e.setContext(A)}function Qs(){return Rs("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function zs(){return Rs("global context")}function qs(){return Rs("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Vs="userContext",Ys="globalContext",js="accountContext",Hs="getContext",Xs="setContext",Ws="setContextProperty",$s="removeContextProperty",Ks="clearContext",Js={FETCH:"fetch",XHR:"xhr"};function Zs(t,e,n){const r=n.getHandler(),i=Array.isArray(r)?r:[r];return ea[t]>=ea[n.getLevel()]&&i.includes(e)}const ta={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},ea={[ta.ok]:0,[ta.debug]:1,[ta.info]:2,[ta.notice]:4,[ta.warn]:5,[ta.error]:6,[ta.critical]:7,[ta.alert]:8,[ta.emerg]:9};function na(t,{includeMessage:e=!1}={}){return{stack:t.stack,kind:t.type,message:e?t.message:void 0,causes:t.causes,fingerprint:t.fingerprint,handling:t.handling}}var ra=function(t,e,n,r){var i,A=arguments.length,o=A<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(A<3?i(o):A>3?i(e,n,o):i(e,n))||o);return A>3&&o&&Object.defineProperty(e,n,o),o};const ia="console",Aa="http",oa=Object.keys(ta);class sa{constructor(t,e,n=Aa,r=ta.debug,i={}){this.handleLogStrategy=t,this.handlerType=n,this.level=r,this.contextManager=Rs("logger"),this.tags=[],this.contextManager.setContext(i),e&&this.contextManager.setContextProperty("logger",{name:e})}logImplementation(t,e,n=ta.info,r,i){const A=HA(e);let o;if(null!=r){const t=ZA({originalError:r,nonErrorPrefix:"Provided",source:so,handling:"handled",startClocks:ii()});o=xo({error:na(t,{includeMessage:!0})},t.context,A)}else o=A;this.handleLogStrategy({message:HA(t),context:o,status:n},this,i)}log(t,e,n=ta.info,r){let i;Zs(n,Aa,this)&&(i=GA("log")),this.logImplementation(t,e,n,r,i)}setContext(t){this.contextManager.setContext(t)}getContext(){return this.contextManager.getContext()}setContextProperty(t,e){this.contextManager.setContextProperty(t,e)}removeContextProperty(t){this.contextManager.removeContextProperty(t)}clearContext(){this.contextManager.clearContext()}addTag(t,e){this.tags.push(bo(t,e))}removeTagsWithKey(t){const e=wo(t);this.tags=this.tags.filter(t=>t!==e&&!t.startsWith(`${e}:`))}getTags(){return this.tags.slice()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function aa(t){return function(e,n,r){let i;Zs(t,Aa,this)&&(i=GA("log")),this.logImplementation(e,n,t,r,i)}}function ua(){return kr?{}:{view:{referrer:document.referrer,url:window.location.href}}}ra([function(t,e,n){const r=n.value;n.value=function(...t){return(Fr?Qr(r):r).apply(this,t)}}],sa.prototype,"logImplementation",null),sa.prototype.ok=aa(ta.ok),sa.prototype.debug=aa(ta.debug),sa.prototype.info=aa(ta.info),sa.prototype.notice=aa(ta.notice),sa.prototype.warn=aa(ta.warn),sa.prototype.error=aa(ta.error),sa.prototype.critical=aa(ta.critical),sa.prototype.alert=aa(ta.alert),sa.prototype.emerg=aa(ta.emerg);function ca(t,e,n){return void 0===t?[]:"all"===t||Array.isArray(t)&&t.every(t=>e.includes(t))?"all"===t?e:function(t){const e=new Set;return t.forEach(t=>e.add(t)),Array.from(e)}(t):void xr.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function la(t){const e={session_sample_rate:(n=t).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent,use_allowed_tracking_origins:Array.isArray(n.allowedTrackingOrigins),beta_encode_cookie_options:n.betaEncodeCookieOptions,source:n.source,sdk_version:n.sdkVersion,variant:n.variant};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}function fa(t,e,n){const r=function(){const t=[];return{add:e=>{t.push(e)>500&&t.splice(0,1)},remove:e=>{cs(t,e)},drain:e=>{t.forEach(t=>t(e)),t.length=0}}}(),i=zs();Bs(i,Ys,r);const A=Qs();Bs(A,js,r);const o=qs();let s,a;Bs(o,Vs,r);const u=e.observable.subscribe(c);function c(){if(!a||!s||!e.isGranted())return;u.unsubscribe();const t=n(s,a);r.drain(t)}return{init(t,n){if(!t)return void xr.error("Missing configuration");if(bA(t.enableExperimentalFeatures),qo()&&(t=function(t){return{...t,clientToken:"empty"}}(t)),s=t,function(t){is().notify({rawEvent:{type:Zo,configuration:t}})}(la(t)),a)return void fo("DD_LOGS",t);const r=function(t,e){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&xr.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=_A(t,e),r=ca(t.forwardConsoleLogs,xi(wr),"Forward Console Logs"),i=ca(t.forwardReports,xi(go),"Forward Reports");if(n&&r&&i)return t.forwardErrorsToLogs&&!r.includes(wr.error)&&r.push(wr.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:32768,...n}}(t,n);r&&(a=r,Ls().subscribe(ai),e.tryToInit(r.trackingConsent),c())},get initConfiguration(){return s},globalContext:i,accountContext:A,userContext:o,getInternalContext:ai,handleLog(e,n,i,A=t(),o=ni()){r.add(t=>t.handleLog(e,n,i,A,o))}}}function ha(t,e){return"0"===(n=e)||"1"===n?e:Tr(t.sessionSampleRate)?"1":"0";var n}function pa(t,e,n,r,i,A){const o=oa.concat(["custom"]),s={};o.forEach(t=>{s[t]=function(t,e,n=3e3){let r=0,i=!1;return{isLimitReached(){if(0===r&&Yr(()=>{r=0},ti),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{e({message:`Reached max number of ${t}s by minute: ${n}`,source:Ao,startClocks:ii()})}finally{i=!1}}return!0}}}(t,i,A)}),e.subscribe(0,({rawLogsEvent:i,messageContext:A,savedCommonContext:o,domainContext:a,ddtags:u=[]})=>{var c,l;const f=i.date-si();const h=o||r(),p=n.triggerHook(0,{startTime:f});if(p===$o)return;const d=vo(t),g=xo({view:h.view},p,i,A,{ddtags:d.concat(u).join(",")});!1===(null===(c=t.beforeSend)||void 0===c?void 0:c.call(t,g,a))||g.origin!==Ao&&(null!==(l=s[g.status])&&void 0!==l?l:s.custom).isLimitReached()||e.notify(1,g)})}const da={[wr.log]:ta.info,[wr.debug]:ta.debug,[wr.info]:ta.info,[wr.warn]:ta.warn,[wr.error]:ta.error};function ga(t,e){if(!t.forwardErrorsToLogs)return{stop:ai};const n=(kr?new $r:Cs(t)).subscribe(t=>{"complete"===t.state&&A(Js.XHR,t)}),r=Ls({responseBodyAction:t=>i(t)?2:0}).subscribe(t=>{"resolve"===t.state&&A(Js.FETCH,t)});function i(t){return e=t.url,!hA.every(t=>e.includes(t))&&(function(t){return 0===t.status&&"opaque"!==t.responseType}(t)||No(t.status));var e}function A(n,r){if(!i(r))return;const A="error"in r&&r.error?UA(IA(r.error)):r.responseBody||"Failed to load",o={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${ya(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:li(A,t.requestErrorResponseLengthLimit,"..."),handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:ta.error,origin:ao},domainContext:o})}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function ya(t){return Js.XHR===t?"XHR":"Fetch"}const _a=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach(t=>t(e))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(t=>e!==t)}}}};function ma(t){return{handleLog:function(e,n,r,i,A){const o=xo(n.getContext(),e.context);if(Zs(e.status,ia,n)&&function({status:t,message:e},n){Cr[va[t]].call(Er,e,n)}(e,o),Zs(e.status,Aa,n)){const s={rawLogsEvent:{date:A||ni(),message:e.message,status:e.status,origin:so},messageContext:o,savedCommonContext:i,ddtags:n.getTags()};r&&(s.domainContext={handlingStack:r}),t.notify(0,s)}}}}const va={[ta.ok]:wr.debug,[ta.debug]:wr.debug,[ta.info]:wr.info,[ta.notice]:wr.info,[ta.warn]:wr.warn,[ta.error]:wr.error,[ta.critical]:wr.error,[ta.alert]:wr.error,[ta.emerg]:wr.error};const ba=function(){const t={};return{register:(e,n)=>(t[e]||(t[e]=[]),t[e].push(n),{unregister:()=>{t[e]=t[e].filter(t=>t!==n)}}),triggerHook(e,n){const r=t[e]||[],i=[];for(const t of r){const e=t(n);if(e===$o)return $o;e!==Ko&&i.push(e)}return xo(...i)}}};const wa="logs";const Ea=function(t){const e=function(t){const e=new $r;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===iA.GRANTED,observable:e}}(),n=function(t=lo){const e=new Jr(500),n=t().subscribe(t=>{e.notify({type:0,error:t})});return{observable:e,stop:()=>{n.unsubscribe()}}}().observable;let r=fa(ua,e,(i,A)=>{const o=t(A,ua,e,n);return r=function(t,e){return{init:t=>{fo("DD_LOGS",t)},initConfiguration:t,...e}}(i,o),o});const i=()=>r,A={};return function(t){const e={version:"6.25.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>Ur,enumerable:!1}),e}({logger:new sa((...t)=>r.handleLog(...t)),init:t=>{const e=(new Error).stack;zr(()=>r.init(t,e))},setTrackingConsent:Qr(t=>{var n;e.update(t),n={feature:"set-tracking-consent",tracking_consent:t},is().notify({rawEvent:{type:ts,usage:n}})}),getGlobalContext:ks(i,Ys,Hs),setGlobalContext:ks(i,Ys,Xs),setGlobalContextProperty:ks(i,Ys,Ws),removeGlobalContextProperty:ks(i,Ys,$s),clearGlobalContext:ks(i,Ys,Ks),createLogger:Qr((t,e={})=>(A[t]=new sa((...t)=>r.handleLog(...t),HA(t),e.handler,e.level,HA(e.context)),A[t])),getLogger:Qr(t=>A[t]),getInitConfiguration:Qr(()=>Io(r.initConfiguration)),getInternalContext:Qr(t=>r.getInternalContext(t)),setUser:ks(i,Vs,Xs),getUser:ks(i,Vs,Hs),setUserProperty:ks(i,Vs,Ws),removeUserProperty:ks(i,Vs,$s),clearUser:ks(i,Vs,Ks),setAccount:ks(i,js,Xs),getAccount:ks(i,js,Hs),setAccountProperty:ks(i,js,Ws),removeAccountProperty:ks(i,js,$s),clearAccount:ks(i,js,Ks)})}(function(t,e,n,r){const i=new _a,A=ba(),o=[];i.subscribe(1,t=>Eo("logs",t));const s=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Ao,status:ta.error}}),os("Error reported to customer",{"error.message":e.message})}}(i),a=kr?new $r:function(t){return new $r(e=>{const{stop:n}=po(t,window,["visibilitychange","freeze"],t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Vo.HIDDEN}):"freeze"===t.type&&e.notify({reason:Vo.FROZEN})},{capture:!0}),r=ho(t,window,"beforeunload",()=>{e.notify({reason:Vo.UNLOADING})}).stop;return()=>{n(),r()}})}(t),u=As("browser-logs-sdk",t,A,s,a,bs);o.push(u.stop);const c=!t.sessionStoreStrategyType||qo()||ds()?function(t){const e="1"===ha(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new $r}}(t):function(t,e){const n=ms(t,"logs",e=>ha(t,e),e);return{findTrackedSession:(t,e={returnInactive:!1})=>{const r=n.findSession(t,e);return r&&"1"===r.trackingType?{id:r.id,anonymousId:r.anonymousId}:void 0},expireObservable:n.expireObservable}}(t,n);!function(t,e){function n(){return e.isGranted()?Ko:$o}t.register(0,n),t.register(1,n)}(A,n),function(t,e,n){t.register(0,({startTime:t})=>{const r=n.findTrackedSession(t);return n.findTrackedSession(t,{returnInactive:!0})?{service:e.service,session_id:r?r.id:void 0,session:r?{id:r.id}:void 0}:$o}),t.register(1,({startTime:t})=>{const e=n.findTrackedSession(t);return e&&e.id?{session:{id:e.id}}:Ko})}(A,t,c);const l=function(t,e,n){const r=Qs();return e.storeContextsAcrossPages&&Us(e,r,n,4),t.register(0,()=>{const t=r.getContext();return Or(t)||!t.id?Ko:{account:t}}),r}(A,t,wa),f=function(t,e,n,r){const i=qs();return e.storeContextsAcrossPages&&Us(e,i,r,1),t.register(0,({eventType:t,startTime:r})=>{const A=i.getContext(),o=n.findTrackedSession(r);return o&&o.anonymousId&&!A.anonymous_id&&e.trackAnonymousUser&&(A.anonymous_id=o.anonymousId),Or(A)?Ko:{type:t,usr:A}}),t.register(1,({startTime:t})=>{var e;return{anonymous_id:null===(e=n.findTrackedSession(t))||void 0===e?void 0:e.anonymousId}}),i}(A,t,c,wa),h=function(t,e,n){const r=zs();return e.storeContextsAcrossPages&&Us(e,r,n,2),t.register(0,()=>r.getContext()),r}(A,t,wa);!function(t){const e=Rr;function n(t){const n=function(t,e){if(e&&e.getInternalContext)return e.getInternalContext(t)}(t,ds()?e.DD_RUM_SYNTHETICS:e.DD_RUM);if(n)return n}t.register(0,({startTime:t})=>n(t)||Ko),t.register(1,({startTime:t})=>{var e,r;const i=n(t);return i?{application:{id:i.application_id},view:{id:null===(e=i.view)||void 0===e?void 0:e.id},action:{id:null===(r=i.user_action)||void 0===r?void 0:r.id}}:Ko})}(A),ga(t,i),function(t,e,n){if(!t.forwardErrorsToLogs)return{stop:ai};const r=n.subscribe(t=>{if(0===t.type){const n=t.error;e.notify(0,{rawLogsEvent:{message:n.message,date:n.startClocks.timeStamp,error:na(n),origin:uo,status:ta.error},messageContext:n.context})}})}(t,i,r),r.unbuffer(),function(t,e){const n=Ms(t.forwardConsoleLogs).subscribe(t=>{var n;const r={rawLogsEvent:{date:ni(),message:t.message,origin:oo,error:t.error&&na(t.error),status:da[t.api]},messageContext:null===(n=t.error)||void 0===n?void 0:n.context,domainContext:{handlingStack:t.handlingStack}};e.notify(0,r)})}(t,i),function(t,e){const n=yo(t,t.forwardReports).subscribe(t=>{let n,r=t.message;const i="deprecation"===t.originalError.type?ta.warn:ta.error;var A,o;i===ta.error?n=na(t):t.stack&&(r+=` Found in ${A=t.stack,null===(o=/@ (.+)/.exec(A))||void 0===o?void 0:o[1]}`),e.notify(0,{rawLogsEvent:{date:ni(),message:r,origin:co,error:n,status:i}})})}(t,i);const{handleLog:p}=ma(i);if(pa(t,i,A,e,s),qo())!function(t){const e=zo();t.subscribe(1,t=>{e.send("log",t)})}(i);else{const{stop:e}=function(t,e,n,r,i){const A=[t.logsEndpointBuilder];t.replica&&A.push(t.replica.logsEndpointBuilder);const o=jo({encoder:bs(),request:Bo(A,n),flushController:Wo({pageMayExitObservable:r,sessionExpireObservable:i.expireObservable})});return e.subscribe(1,t=>{o.add(t)}),o}(t,i,s,a,c);o.push(()=>e())}var d;return{handleLog:p,getInternalContext:(d=c,{get:t=>{const e=d.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,accountContext:l,globalContext:h,userContext:f,stop:()=>{o.forEach(t=>t())}}});!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&xr.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach(t=>Lr(t,"onReady callback threw an error:")())}(Pr(),"DD_LOGS",Ea);const Ca="1.0.1",Ia="SDKLogger",xa={SDK:`[SkyPathSDK v${Ca}]:`,NETWORK:"[Network]:"},Sa=()=>Ea.getLogger(Ia),Na=t=>{if(!t)return{};try{if(t instanceof Response)return Da(t);if(t instanceof Error)return{message:t.message,name:t.name,stack:t.stack,...Na(t.context)};if(Array.isArray(t))return t.map(t=>Na(t));if("object"==typeof t){const e={};for(const[n,r]of Object.entries(t))if("response"===n&&r instanceof Response)e[n]=Da(r);else if(r instanceof Error)e[n]={message:r.message,name:r.name,stack:r.stack,...Na(r.context)};else if("object"==typeof r&&null!==r)try{JSON.stringify(r),e[n]=Na(r)}catch{e[n]="[Circular or Non-Serializable]"}else e[n]=r;return e}return t}catch(t){return{serializationError:"Failed to serialize context",originalErrorMessage:t.message}}},Da=t=>{if(!t)return{};const e={};if(t.headers&&"function"==typeof t.headers.entries)for(const[n,r]of t.headers.entries())e[n]=r;return{status:t.status,statusText:t.statusText,url:t.url,headers:e,type:t.type}},La="Invalid listener",Ta="Missing authentication parameters",Ma="Failed to authenticate with authCallback",Oa="Failed to authenticate with API key",Pa="Failed to get authentication token",Ra="Failed to fetch user config; continuing with empty config";class ka extends Error{constructor({error:t,context:e={}}){t||=new Error("Unknown error"),super(t.message),this.name=this.constructor.name,this.context=e;const n=Sa(),r=Na(e);n?.error(this.message,{context:r},e?.error||t)}}class Ba extends ka{constructor(t,e={}){super({error:new Error(t),context:e})}}class Fa extends ka{constructor(t,e={}){super({error:new Error(t),context:e})}}class Ga extends ka{constructor(t,e={}){super({error:new Error(t),context:e})}}class Ua extends ka{constructor(t,e={}){super({error:new Error(t),context:e})}}class Qa extends ka{constructor(t,e={}){super({error:new Error(t),context:e})}}class za{constructor({service:t,cacheTokenService:e}){this.#t=t,this.#e=e,this.#e.start(),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:3e5}),this.#A={polygon:null,isCorridorMode:!1,isEnabled:!0},this.#o={forecast:0,maxAltitude:k,minAltitude:R,minSeverity:0}}#A;#o;#t;#e;#n;#s=!1;#a;#u;#r;#i;#c=er();#l;#f;#h;#p=async({isRequiredNewFetch:t})=>{if(this.#a)try{this.#t.expire();const e=this.#e.getToken();if((t||!this.#s)&&this.#A.polygon&&e){this.#s=!0,this.#u&&(this.#n.abort(fr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch({config:this.#A,token:e,signal:this.#n.signal});this.#d(t),await t}const n=this.#t.getData({config:this.#A,filters:this.#o});this.#l?.(n,this.#c),this.#c=n}catch(t){const e=new Qa("Failed to run Forecast flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#A.polygon&&t&&this.#i.run(this.#p.bind(this,{isRequiredNewFetch:!0}))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#a=!1,this.#n.abort(fr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new Qa("Failed to stop Forecast flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ba(La);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ba(La);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ba(La);this.#h=t};start=()=>{this.#a=!0,this.#p({isRequiredNewFetch:!0})};stop=()=>this.#g();terminate=()=>{this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e,isEnabled:n,forecast:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{try{(({polygon:t,forecast:e,isCorridorMode:n,isEnabled:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [longitude, latitude]")}if(!H({value:n})&&"boolean"!=typeof n)throw new Error("isCorridorMode must be a boolean");if(!H({value:r})&&"boolean"!=typeof r)throw new Error("isEnabled must be a boolean");if(!H({value:e})){if("number"!=typeof e)throw new Error("forecast must be a number");if(!Hn.includes(e))throw new Error("forecast must be a number between 0 and 24")}if(!H({value:i})){if("number"!=typeof i)throw new Error("maxAltitude must be a number");if(i<A)throw new Error("maxAltitude must be a higher value than minAltitude");if(i<R||i>k)throw new Error("maxAltitude must be a number between 0 and 52")}if(!H({value:A})){if("number"!=typeof A)throw new Error("minAltitude must be a number");if(A<R||A>k)throw new Error("minAltitude must be a number between 0 and 52")}if(!H({value:o})){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(!jn.includes(o))throw new Error("minSeverity must be a number between 0 and 4")}})({polygon:t,isCorridorMode:e,isEnabled:n,forecast:r,maxAltitude:i,minAltitude:A,minSeverity:o});const s={...this.#A},a=Z({current:this.#A,next:{polygon:t,isCorridorMode:e,isEnabled:n}});a.has(Kn)&&(s.isCorridorMode=e),a.has(Jn)&&(s.isEnabled=n),a.has($n)&&(s.polygon=t),this.#A=s,this.#o=J({current:this.#o,next:{forecast:r,maxAltitude:i,minAltitude:A,minSeverity:o}});const u=a.size>0;this.#r.run(this.#p.bind(this,{isRequiredNewFetch:u}))}catch(e){const n=new Qa("Failed to update config for Forecast Flow",{error:e,config:{polygon:t}});if(!this.#f)throw n;this.#f(n)}}}class qa{constructor({fetcher:t,isGtg:e=!1}){this.#y=t,this.#_=new Map,this.#m=e?Wn:Xn,this.#v=null}#_;#m;#y;#b;#v;#w=({polygon:t,polygonSize:e})=>{const n=`${e}-${JSON.stringify(t)}`;if(this.#v?.key===n)return this.#v.result;const r=(({polygon:t,polygonSize:e})=>{const n=F[e];let r,i;if(e===O.CORRIDOR){i=T(t,5,!0);const e=new Set(i.map(t=>D(t,n)));r=Array.from(e)}else if(r=T(t,n,!0),0===r.length){const e=t.map(([t])=>t),i=t.map(([,t])=>t);r=[S((Math.min(...i)+Math.max(...i))/2,(Math.min(...e)+Math.max(...e))/2,n)]}return{hexIds:r,childCells:i}})({polygon:t,polygonSize:e});return this.#v={key:n,result:r},r};fetch=async({config:t,signal:e,token:n})=>{const{polygon:r,isCorridorMode:i,isEnabled:A}=t;if(!r||!A)return;this.#b=await(async()=>{const t=await this.#y({path:this.#m.INFO,method:nr});return t?.data?.lastUpdatedAt})();const o=i?O.CORRIDOR:Gn({polygon:r}),{hexIds:s}=this.#w({polygon:r,polygonSize:o}),a=(({hexIds:t,data:e,currentLastUpdatedAt:n})=>t.filter(t=>{if(!e.has(t))return!0;const r=e.get(t),{lastUpdatedAt:i}=r;return i!==n}))({hexIds:s,data:this.#_,currentLastUpdatedAt:this.#b});if(!a.length||!n)return;const u=a.map(t=>{const r=this.#m.DATA.replace("{res}",String(F[o])).replace("{hexId}",t),i={lastUpdatedAt:this.#b,token:n,forecastH:25};return this.#y({path:r,method:nr,params:i,signal:e})});(await Promise.allSettled(u)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n=a[e],{reports:r}=Zn({response:t.value,lastUpdatedAt:this.#b,parentCell:n});this.#_.set(n,{lastUpdatedAt:this.#b,reports:r})})};getData=({config:t,filters:e})=>{const{polygon:n,isCorridorMode:r,isEnabled:i}=t;if(!n||!i)return er();const{forecast:A,maxAltitude:o,minAltitude:s,minSeverity:a}=e,u=r?O.CORRIDOR:Gn({polygon:n}),{childCells:c}=this.#w({polygon:n,polygonSize:u}),l=(({data:t,filters:e,childCells:n})=>{if(!t)return{};if(!e)return t;const{forecast:r=0,minAltitude:i=R,maxAltitude:A=k,minSeverity:o=1}=e,s=n?.length?new Set(n):null,a={};return t.forEach(({reports:t},e)=>{const n=t.filter(({observationTime:t})=>it.unix(t).diff(it().startOf("hour"),"hour")===r).filter(({alt:t})=>t>=i&&t<=A).filter(({sev:t})=>t>=o).map(t=>{if(!s)return t;const n=t.hexIds.filter(t=>{try{const n=L(t,e,5);return s.has(n)}catch(n){console.warn(`[SkyPath SDK]: Hexagon skipped; ${n?.message||"Error while converting childPos to hexId"}`,{childPos:t,parentCell:e,resolution:5})}});return{...t,hexIds:n}}).filter(t=>t.hexIds.length>0);0!==n.length&&(a[e]=n)}),a})({data:this.#_,filters:{forecast:A,minAltitude:s,maxAltitude:o,minSeverity:a},childCells:c});return er(l)};expire=()=>{this.#_.forEach((t,e)=>{t.lastUpdatedAt!==this.#b&&this.#_.delete(e)})};dispose=()=>{this.#_.clear(),this.#v=null}}const Va="/v4/aircraft";class Ya{constructor({fetcher:t}){this.#y=t}#y;async getMapping(){let t=Va,e=nr;try{return await this.#y({path:t,method:e})}catch(n){throw new Fa("Failed to get aircraft mapping",{path:t,method:e,error:n})}}}const ja=t=>"TypeError"===t?.name&&Object.values(br).some(e=>t?.message?.includes(e)),Ha=async({response:t})=>{const e=t.status,n=t.statusText;let r={400:"Bad request, please check the request body;",401:"Unauthorized, please check the API key or JWT;",403:"Forbidden;",404:"Endpoint is not found, please check the URL;",500:"Internal server error;"}[e]||n||"Unknown error";const i=(await t.json().catch(()=>{}))?.message?.split(":")?.at(1)?.trim()||"";return[r,i?`(${i})`:""].join(" ")},Xa=({error:t})=>{if(!t)return{};const e={name:t.name,message:t.message,type:"unknown",possibleCauses:[]};return ja(t)?(e.type="network_error",e.possibleCauses=["Network connectivity issue","CORS policy violation","SSL/TLS certificate problem","Firewall or proxy blocking the request","DNS resolution failure","Server is unreachable"]):"AbortError"===t.name?(e.type="aborted",e.possibleCauses=["Request was cancelled by AbortController"]):t.message?.includes("timeout")?(e.type="timeout",e.possibleCauses=["Request exceeded timeout limit","Server is not responding"]):t.message?.includes("CORS")&&(e.type="cors_error",e.possibleCauses=["CORS policy violation","Missing CORS headers on server"]),t.cause&&(e.cause=t.cause),t.stack&&(e.stack=t.stack),e},Wa=(t,e,n)=>{const r=`${t}${e}`;if(!n)return r;const i=Object.entries(n).filter(([,t])=>null!=t);if(0===i.length)return r;return`${r}?${new URLSearchParams(Object.fromEntries(i))}`},$a=t=>new Promise(e=>setTimeout(e,t));class Ka{#E;#C;#I=null;#x=!1;constructor({environment:t,proxyUrl:e}){this.#E=e||yr[t?.toLowerCase()]||yr[dr]}authenticate=async({apiKey:t,userId:e,companyName:n,authCallback:r})=>{if(this.#C)throw new Ba("AuthService is already authenticated");if(![t,e,n,r].filter(Boolean).length)throw new Ba(Ta);return this.#C=r?async()=>{const{jwt:t,partnerId:e}=await r();return await this.#S({jwt:t,partnerId:e})}:async()=>await this.#N({apiKey:t,userId:e,companyName:n}),r?await this.#D({authCallback:r}):await this.#L({apiKey:t,userId:e,companyName:n})};#T=async()=>{if(!this.#C)throw new Error("No re-authentication method available");return this.#I||=(async()=>{try{return await this.#C()}finally{this.#I=null}})(),await this.#I};#M=async({tokenProvider:t,request:e})=>{const n=n=>{t.token=n,e.options.headers[Ar]=n};try{return n(await this.#O({token:t.token})),{recovered:!0}}catch(t){try{return n(await this.#T()),{recovered:!0,refreshError:t}}catch(e){return 401===(e?.context?.response?.status??e?.response?.status)&&(this.#x=!0),{recovered:!1,refreshError:t,reauthError:e}}}};async#P({token:t}){const e=`${this.#E}${cr}`,n={method:nr,headers:{[Ar]:t}},r=await fetch(e,n);if(!r.ok){const t=await Ha({response:r});throw new Error(t)}const{data:i}=await r.json(),{companyId:A,id:o}=i;return{companyId:A,userId:o}}async#R({token:t}){try{const e=`${this.#E}${lr}`,n={method:nr,headers:{[Ar]:t}},r=await fetch(e,n);if(!r.ok){const t=await Ha({response:r});throw new Error(t)}const{data:i}=await r.json();return i?.config??{}}catch(t){return new Fa(Ra,{error:t}),{}}}async#L({apiKey:t,userId:e,companyName:n}){try{const r=await this.#N({apiKey:t,userId:e,companyName:n}),i={token:r},A=await this.#P({token:r}),o=await this.#R({token:r});return{fetcher:this.#k({tokenProvider:i}),me:A,tokenProvider:i,config:o}}catch(t){throw new Ua(Oa,{error:t})}}async#D({authCallback:t}){try{const{jwt:e,partnerId:n}=await t(),r=await this.#S({jwt:e,partnerId:n}),i={token:r},A=await this.#P({token:r}),o=await this.#R({token:r});return{fetcher:this.#k({tokenProvider:i}),me:A,tokenProvider:i,config:o}}catch(t){throw new Ua(Ma,{error:t})}}#B=async({path:t,headers:e={},body:n})=>{let r=null,i=null;try{const A=`${this.#E}${t}`,o={method:rr,headers:{[or]:"application/json",...e},body:n?JSON.stringify(n):null};if(i={url:A,options:o},r=await fetch(A,o),!r.ok){const t=await Ha({response:r});throw new Error(t)}const{data:s}=await r.json(),{token:a}=s;if(!a)throw new Error("Auth response did not contain a token");return a}catch(t){throw new Fa(Pa,{error:t,response:r,request:i})}};#N=async({apiKey:t,userId:e,companyName:n})=>await this.#B({path:sr,headers:{[ir]:t},body:{userId:e,companyName:n}});#S=async({jwt:t,partnerId:e})=>await this.#B({path:ar,body:{signedJwt:t,partnerId:e}});#O=async({token:t})=>await this.#B({path:ur,body:{token:t}});#k=({tokenProvider:t})=>async({path:e="",method:n=nr,params:r,headers:i={},body:A=null,signal:o=null,retry:s=3})=>{const a=Sa();if(this.#x)return{data:null,sessionExpired:!0};const u={url:Wa(this.#E,e,r),options:{method:n,headers:(c=i,l={[Ar]:t.token,[or]:"application/json"},{...c,...l}),body:n!==nr?JSON.stringify(A):null,signal:o}};var c,l;const f=[];let h=null,p=0,d=null,g=!1;for(;p<s;){p+=1,g=!1;try{if(h=await fetch(u.url,u.options),h?.ok)return 204===h.status?{data:null}:await h.json()}catch(t){if("AbortError"===t?.name||t?.reason===fr||t===fr)return{data:null,aborted:!0};if(ja(t))return{data:null,networkError:!0};d=t}if(h){const{status:e}=h,n=401===e,r=429===e,i=e>=500&&e<600;if(n&&p<s){const{recovered:e,refreshError:n,reauthError:r}=await this.#M({tokenProvider:t,request:u});if(n&&f.push({type:"token_refresh_failed",timestamp:(new Date).toISOString(),errorDetails:Xa({error:n}),request:u,response:h,attempt:p,error:n,lastError:d}),!e){f.push({type:"reauthentication_failed",timestamp:(new Date).toISOString(),errorDetails:Xa({error:r}),request:u,response:h,attempt:p,error:r,lastError:d});break}g=!0}else{if(n)break;if(e>=400&&e<500&&!r){f.push({type:"client_error",timestamp:(new Date).toISOString(),request:u,response:h,attempt:p,lastError:d});break}f.push({attempt:p,timestamp:(new Date).toISOString(),request:u,response:h,type:i?"server_error":"retryable_error",lastError:d})}}p<s&&!g&&await $a(1e3*p)}const y=h?await Ha({response:h}):"Network request failed after all retries";throw a?.error(y,{context:{url:u.url,method:u.options.method,totalAttempts:p,lastError:d,attempts:f,finalErrorDetails:Xa({error:d}),finalResponse:h?{status:h.status,statusText:h.statusText,url:h.url}:null}}),new Fa(y,{response:h,request:u,attempts:f,lastError:d,totalAttempts:p})}}const Ja={DATA:"/adsb/v5/hexagons/{resolution}/{hexId}"},Za={[O.SMALL]:0,[O.MEDIUM]:1,[O.LARGE]:1,[O.CORRIDOR]:1},tu={[O.SMALL]:2,[O.MEDIUM]:1,[O.LARGE]:2.5,[O.CORRIDOR]:1},eu="polygon",nu="isCorridorMode",ru=(t,e,n={})=>{const{childCells:r}=n,i=[...t.entries()].filter(([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")}).map(([t,e])=>{const[n]=t.split(","),{reports:i}=e;if(!r?.length)return[n,i];const A=i.filter(t=>{const{hexId:e}=t,i=L(e,n,5);return r.includes(i)});return[n,A]});return Object.fromEntries(i)},iu=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],observationTime:e.observationTime[n]}))};class Au{constructor({fetcher:t}){this.#y=t,this.#_=new Map}#_;#y;fetch=async(t,e)=>{const{polygon:n,polygonSize:r}=t;if(!n||!r)return null;r===O.CORRIDOR&&Bn({polygon:n});const i=Za[r],{hexIds:A,childCells:o}=(({polygon:t,polygonSize:e})=>{let n=t;const r=F[e],i=tu[e];let A,o;switch(e){case O.LARGE:n=qn({polygon:n,resolution:r,extensionFactor:i});break;case O.CORRIDOR:{o=T(n,5,!0);const t=t=>D(t,1),e=new Set(o.map(t));A=Array.from(e);break}default:n=Rn({polygon:n,resolution:r,extensionFactor:i})}return A??=T(n,r,!0),{hexIds:A,childCells:o}})({polygon:n,polygonSize:r});r===O.LARGE&&([...this.#_.keys()].forEach(t=>!t.includes(r)&&this.#_.delete(t)),[...this.#_.keys()].forEach(t=>!A.includes(t.split(",")[0])&&this.#_.delete(t)));const s=A.filter(t=>{const e=String([t,r,i]);if(!this.#_.has(e))return!0;const n=this.#_.get(e),{fetchedAt:A,updatedAt:o}=n,s=it().unix()-A,a=it().unix()-o;return!(s<60)&&!(a<60)});if(!s.length)return ru(this.#_,[r,i],{childCells:o});const a=s.map(t=>{const n=Ja.DATA.replace("{hexId}",t).replace("{resolution}",String(F[r])),A=String([t,r,i]),o=this.#_.get(A)?.updatedAt;return this.#y({path:n,method:nr,params:{minSev:i,hoursAgo:4,maxAlt:B.ALT_TO,minAlt:B.ALT_FROM,since:o},signal:e})});return(await Promise.allSettled(a)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n={fetchedAt:it().unix(),reports:iu(t),updatedAt:t.value.data?.updatedAt},A=s[e],o=String([A,r,i]),a=this.#_.get(o);if(!!a?.updatedAt&&!!a?.reports?.length&&a?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=a.reports,i=n.reports;r.forEach(n=>t.set(e(n),n)),i.forEach(n=>t.set(e(n),n));const A=Array.from(t.values()),s={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:A};this.#_.set(o,s)}else this.#_.set(o,n)}),[...this.#_.keys()].forEach(t=>!t.includes(r)&&this.#_.delete(t)),ru(this.#_,[r,i],{childCells:o})};expire=()=>{const t=[...this.#_.entries()],e=it().unix();t.forEach(t=>{const[n,r]=t,{reports:i,...A}=r,o=i.filter(t=>e-t.observationTime<14400);this.#_.set(n,{...A,reports:o})})};dispose=()=>this.#_.clear()}class ou{constructor({fetcher:t}){this.#t=new Au({fetcher:t}),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:6e4}),this.#A={polygon:null,polygonSize:null,isCorridorMode:!1}}#A;#t;#n;#a;#u;#c;#r;#i;#l;#f;#h;#p=async()=>{if(this.#a)try{this.#t.expire(),this.#u&&(this.#n.abort(fr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch(this.#A,this.#n.signal);this.#d(t);const e=await t;this.#l?.(e,this.#c),this.#c=e}catch(t){const e=new Qa("Failed to run ADSB flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#i.run(this.#p.bind(this))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#a=!1,this.#n.abort(fr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new Qa("Failed to stop ADSB flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ba(La);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ba(La);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ba(La);this.#h=t};start=()=>{this.#a=!0,this.#p()};stop=()=>this.#g();terminate=()=>{this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e})=>{try{(({polygon:t,isCorridorMode:e})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!H({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean")})({polygon:t,isCorridorMode:e});const n=Z({current:this.#A,next:{polygon:t,isCorridorMode:e}}),r={...this.#A};if(n.has(nu)&&(r.isCorridorMode=e),n.has(eu)&&(r.polygon=t,r.polygonSize=r.isCorridorMode?O.CORRIDOR:Gn({polygon:t})),this.#A=r,!this.#a)return;this.#r.run(this.#p.bind(this))}catch(n){const r=new Qa("Failed to updateConfig for ADSB flow",{error:n,config:{polygon:t,isCorridorMode:e}});if(!this.#f)throw r;this.#f(r)}}}const su=({reports:t,forecastTs:e,hoursAgo:n})=>{const r=(({forecastTs:t})=>{const e=it().unix();return!t||t<=e||t<e+180?e:t})({forecastTs:e}),i=3600*Number(n);return t.map(t=>{const{severities:e,...n}=t,A=e?.find((t,e,n)=>{const A=n[e+1],o=t.observationTime,s=t.observationTime+i,a=A?Math.min(A.observationTime,s):s;return r>=o&&r<a})||{};return{...n,...A}}).filter(t=>t.observationTime)},au=({oneLayerStore:t,forecastData:e,selector:n,options:{childCells:r,forecastTs:i,hoursAgo:A,isForecastEnabled:o}})=>{const[s]=n,a=r?.length?new Set(r):null,u=new Map;for(const[e,n]of t){const[t,r]=e.split(",");u.has(t)||u.set(t,[]),u.get(t).push({key:e,value:n,polygonSize:r})}if(e&&s!==O.LARGE)for(const t of Object.keys(e))u.has(t)||u.set(t,[]);const c=[];for(const[t,e]of u)if(0===e.length)c.push([t,{reports:[]}]);else if(1===e.length)c.push([e[0].key,e[0].value]);else{const t=e.find(t=>t.polygonSize===s);t&&c.push([t.key,t.value])}const l=c.map(([t,n])=>{const[r]=t.split(","),{reports:s}=n,u=su({reports:s,forecastTs:i,hoursAgo:A}),c=e&&e[r]&&o?(({oneLayer:t,forecast:e})=>{const n=new Map;return t.forEach(t=>n.set(`${t.hexId}-${t.alt}`,t)),e?.forEach(t=>{t.hexIds.forEach(e=>{const r=`${e}-${t.alt}`;if(n.has(r)){const t=n.get(r);if(t.sources.includes(0))return;n.set(r,{...t,sources:[...t.sources,0]})}else n.set(r,(({hexId:t,forecastItem:e})=>({hexId:t,alt:e.alt,edr:null,sev:2===e.sev?1:e.sev,sources:[0],usedSource:0,observationTime:e.observationTime,usedSourceTs:e.observationTime}))({hexId:e,forecastItem:t}))})}),[...n.values()]})({oneLayer:u,forecast:e[r]}):u;if(!a)return[r,c];const l=c.filter(t=>{const{hexId:e}=t,n=L(e,r,5);return a.has(n)});return[r,l]});return Object.fromEntries(l)},uu=({responseData:t})=>t?t.hexId.map((e,n)=>({hexId:e,alt:t.alt[n],severities:t.severities.sev[n].map((e,r)=>({edr:t.severities.edr[n][r],sev:t.severities.sev[n][r],sources:t.severities.sources[n][r],observationTime:t.severities.ts[n][r],usedSource:t.severities.usedSource[n][r],usedSourceTs:t.severities.usedSourceTs[n][r]}))})):[],cu=t=>{let e=null,n=null;return{toRawObject:()=>t||null,toHexagonsArray:()=>t?(null!==e||(e=On({data:t})),e):null,toFeatureCollection:()=>{if(!t)return null;if(null!==n)return n;const r=e??On({data:t});null===e&&(e=r);const i=Nn({hexagons:r});return n=Sn({hexagons:Object.values(i)}),n}}};class lu{constructor({fetcher:t}){this.#y=t,this.#_=new Map,this.#v=null}#_;#y;#v;#w=({polygon:t,polygonSize:e})=>{const n=`${e}-${JSON.stringify(t)}`;if(this.#v?.key===n)return this.#v.result;const r=(({polygon:t,polygonSize:e})=>{let n=t;const r=F[e],i=dn[e];let A,o;switch(e){case O.LARGE:n=qn({polygon:n,resolution:r,extensionFactor:i});break;case O.CORRIDOR:{o=T(n,5,!0);const t=t=>D(t,1),e=new Set(o.map(t));A=Array.from(e);break}default:n=Rn({polygon:n,resolution:r,extensionFactor:i})}return A??=T(n,r,!0),{hexIds:A,childCells:o}})({polygon:t,polygonSize:e});return this.#v={key:n,result:r},r};fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:i,hoursAgo:A}=t;if(!n||!r)return null;r===O.CORRIDOR&&Bn({polygon:n});const o=pn[r],{hexIds:s}=this.#w({polygon:n,polygonSize:r});r===O.LARGE&&[...this.#_.keys()].forEach(t=>!s.includes(t.split(",")[0])&&this.#_.delete(t));const a=it().unix(),u=s.filter(t=>{const e=String([t,r,o,A,i]);if(!this.#_.has(e))return!0;const n=this.#_.get(e),{fetchedAt:s,updatedAt:u}=n;return!(a-s<60||a-u<60)});if(!u.length)return;const c=u.map(t=>{const n=hn.DATA.replace("{hexId}",t).replace("{res}",String(F[r])),s=String([t,r,o,A,i]),a=this.#_.get(s)?.updatedAt;return this.#y({path:n,method:nr,params:{acCat:i,hoursAgo:A,minAlt:B.ALT_FROM,maxAlt:B.ALT_TO,since:a},signal:e})});(await Promise.allSettled(c)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n={fetchedAt:it().unix(),reports:uu({responseData:t?.value?.data}),updatedAt:t.value.data?.updatedAt},s=u[e],a=String([s,r,o,A,i]),c=this.#_.get(a);if(!!c?.updatedAt&&!!c?.reports?.length&&c?.updatedAt!==n.updatedAt){const t=(({oldReports:t,newReports:e})=>{const n=new Map,r=({item:t})=>`${t.hexId}-${t.alt}`;return t.forEach(t=>n.set(r({item:t}),t)),e.forEach(t=>n.set(r({item:t}),t)),Array.from(n.values())})({oldReports:c.reports,newReports:n.reports}),e={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:t};this.#_.set(a,e)}else this.#_.set(a,n)})};getData=({config:t,filters:e,forecastData:n})=>{const{polygon:r,polygonSize:i,aircraftCategory:A,hoursAgo:o,isForecastEnabled:s}=t,{maxAltitude:a,minAltitude:u,minSeverity:c,forecastTs:l}=e;if(!r||!i)return cu();const f=pn[i],{childCells:h}=this.#w({polygon:r,polygonSize:i}),p=au({oneLayerStore:this.#_,forecastData:n,selector:[i,f,o,A],options:{childCells:h,forecastTs:l,hoursAgo:o,isForecastEnabled:s}}),d=Mn({data:p,filters:{minAltitude:u,maxAltitude:a,minSeverity:c,hoursAgo:o,polygonSize:i}});return cu(d)};expire=()=>{this.#_=(({store:t,hoursAgo:e})=>{const n=new Map(t),r=it().unix(),i=3600*Number(e);return[...n.entries()].forEach(t=>{const[e,A]=t,{reports:o,...s}=A,a=[];o.forEach(t=>{const e=t?.severities?.filter(t=>t.observationTime+i>r);e.length&&a.push({...t,severities:e})}),a.length?n.set(e,{...s,reports:a}):n.delete(e)}),n})({store:this.#_,hoursAgo:Number(fn.fourHours)})};dispose=()=>{this.#_.clear(),this.#v=null}}class fu{constructor({fetcher:t,cacheTokenService:e,forecastService:n,isForecastActive:r}){this.#t=new lu({fetcher:t}),this.#F=r,r&&(this.#G=new za({service:n,cacheTokenService:e})),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:6e4}),this.#A={polygon:null,polygonSize:null,isCorridorMode:!1,isForecastEnabled:!0,hoursAgo:Number(fn.oneHour),aircraftCategory:ln.C60},this.#o={forecastTs:null,forecastAlt:35,maxAltitude:B.ALT_TO,minAltitude:B.ALT_FROM,minSeverity:B.SEVERITY}}#A;#o;#t;#G;#F;#n;#a;#U;#u;#c=cu();#r;#i;#l;#f;#h;#p=async({isRequiredNewFetch:t})=>{if(this.#a)try{if(this.#t.expire(),t&&this.#A.polygon){this.#u&&(this.#n.abort(fr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch({config:this.#A,signal:this.#n.signal});this.#d(t),await t}const e=this.#t.getData({config:this.#A,filters:this.#o,forecastData:this.#U});this.#l?.(e,this.#c),this.#c=e}catch(t){const e=new Qa("Failed to run OneLayer flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#A.polygon&&t&&this.#i.run(this.#p.bind(this,{isRequiredNewFetch:!0}))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#F&&this.#G.stop(),this.#a=!1,this.#n.abort(fr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new Qa("Failed to stop OneLayer flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ba(La);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ba(La);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ba(La);this.#h=t};start=()=>{this.#F&&(this.#G.start(),this.#G.onData(t=>{this.#U=t.toRawObject(),this.#p({isRequiredNewFetch:!1})})),this.#a=!0,this.#p({isRequiredNewFetch:!0})};stop=()=>this.#g();terminate=()=>{this.#F&&this.#G.terminate(),this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:i,forecastTs:A,forecastAlt:o,maxAltitude:s,minAltitude:a,minSeverity:u})=>{try{(({polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:i,maxAltitude:A,minAltitude:o,minSeverity:s,forecastTs:a,forecastAlt:u})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!H({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!H({value:n})&&"boolean"!=typeof n)throw new Error("isForecastEnabled must be a boolean");if(!H({value:r})){if("string"!=typeof r)throw new Error("aircraftCategory must be a string");if(!Object.values(ln).includes(r))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!H({value:i})){if("string"!=typeof i)throw new Error("hoursAgo must be a string");if(!Object.values(fn).includes(i))throw new Error("hoursAgo must be one of the allowed values, '0.5', '1', '2' ,'4'")}if(!H({value:A})){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<o)throw new Error("maxAltitude must be a higher value than minAltitude");if(A<R||A>k)throw new Error("maxAltitude must be a number between 0 and 52")}if(!H({value:o})){if("number"!=typeof o)throw new Error("minAltitude must be a number");if(o>A)throw new Error("minAltitude must be a lower value than maxAltitude");if(o<R||o>k)throw new Error("minAltitude must be a number between 0 and 52")}if(!H({value:s})){if("number"!=typeof s)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(s))throw new Error("minSeverity must be a number between 0 and 4")}if(!H({value:a})){if("number"!=typeof a)throw new Error("forecastTs must be a number");if(!it.unix(a).isValid())throw new Error("forecastTs must be a valid Unix timestamp")}if(!H({value:u})){if("number"!=typeof u)throw new Error("forecastAlt must be a number");if(u<R||u>k)throw new Error(`forecastAlt must be a number between ${R} and ${k}`)}})({polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:i,forecastTs:A,forecastAlt:o,maxAltitude:s,minAltitude:a,minSeverity:u});const c={...this.#A},l=Z({current:this.#A,next:{polygon:t,isCorridorMode:e,isForecastEnabled:n,aircraftCategory:r,hoursAgo:Number(i)}});l.has(yn)&&(c.isCorridorMode=e),l.has(_n)&&(c.isForecastEnabled=n),l.has(gn)&&(c.polygon=t,c.polygonSize=c.isCorridorMode?O.CORRIDOR:Gn({polygon:t})),l.has(mn)&&(c.aircraftCategory=r),l.has(vn)&&(c.hoursAgo=Number(i)),this.#A=c,this.#o=J({current:this.#o,next:{forecastTs:A,forecastAlt:o,maxAltitude:s,minAltitude:a,minSeverity:u}});const f=this.#o.forecastTs?Math.min(24,Math.max(0,it.unix(this.#o.forecastTs).startOf("hour").diff(it().startOf("hour"),"hour"))):0;this.#F&&this.#G.updateConfig({polygon:t,isCorridorMode:e,isEnabled:n,forecast:f,maxAltitude:o??k,minAltitude:o??R,minSeverity:u});const h=l.size>0;this.#r.run(this.#p.bind(this,{isRequiredNewFetch:h}))}catch(i){const A=new Qa("Failed to update config for OneLayerFlow",{error:i,config:{polygon:t,isForecastEnabled:n,isCorridorMode:e,aircraftCategory:r}});if(!this.#f)throw A;this.#f(A)}}}const hu=({polygon:t,polygonSize:e})=>{let n=t;const r=F[e],i=z[e];let A,o;switch(e){case O.LARGE:n=qn({polygon:n,resolution:r,extensionFactor:i});break;case O.CORRIDOR:{o=T(n,5,!0);const t=t=>D(t,1),e=new Set(o.map(t));A=Array.from(e);break}default:n=Rn({polygon:n,resolution:r,extensionFactor:i})}return A??=T(n,r,!0),{hexIds:A,childCells:o}},pu=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],edr:e.edr[n],observationTime:e.observationTime[n]}))},du=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?On({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=On({data:t}),n=Nn({hexagons:e});return Sn({hexagons:Object.values(n)})}});class gu{constructor({fetcher:t}){this.#y=t,this.#_=new Map}#_;#y;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:i}=t;if(!n||!r)return;r===O.CORRIDOR&&Bn({polygon:n});const A=Q[r],{hexIds:o}=hu({polygon:n,polygonSize:r});r===O.LARGE&&[...this.#_.keys()].forEach(t=>!o.includes(t.split(",")[0])&&this.#_.delete(t));const s=o.filter(t=>{const e=String([t,r,A,i]);if(!this.#_.has(e))return!0;const n=this.#_.get(e),{fetchedAt:o,updatedAt:s}=n,a=it().unix()-o,u=it().unix()-s;return!(a<60)&&!(u<60)});if(!s.length)return;const a=s.map(t=>{const n=U.DATA.replace("{hexId}",t).replace("{resolution}",String(F[r])),o=String([t,r,A,i]),s=this.#_.get(o)?.updatedAt;return this.#y({path:n,method:nr,params:{minSev:A,hoursAgo:4,maxAlt:B.ALT_TO,minAlt:B.ALT_FROM,acCat:i,since:s},signal:e})});(await Promise.allSettled(a)).forEach((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted||t.value.networkError)return;const n={fetchedAt:it().unix(),reports:pu(t),updatedAt:t.value.data?.updatedAt},o=s[e],a=String([o,r,A,i]),u=this.#_.get(a);if(!!u?.updatedAt&&!!u?.reports?.length&&u?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=u.reports,i=n.reports;r.forEach(n=>t.set(e(n),n)),i.forEach(n=>t.set(e(n),n));const A=Array.from(t.values()),o={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:A};this.#_.set(a,o)}else this.#_.set(a,n)}),[...this.#_.keys()].forEach(t=>!t.includes(r)&&this.#_.delete(t))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:i}=t;if(!n||!r)return du();const A=Q[r],{childCells:o}=hu({polygon:n,polygonSize:r}),s=((t,e,n={})=>{const{childCells:r}=n,i=[...t.entries()].filter(([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")}).map(([t,e])=>{const[n]=t.split(","),{reports:i}=e;if(!r?.length)return[n,i];const A=i.filter(t=>{const{hexId:e}=t,i=L(e,n,5);return r.includes(i)});return[n,A]});return Object.fromEntries(i)})(this.#_,[r,A,i],{childCells:o}),{historyHours:a,maxAltitude:u,minAltitude:c,minSeverity:l}=e,f=Tn({data:s,filters:{historyHours:a,minAltitude:c,maxAltitude:u,minSeverity:l}});return du(f)};expire=()=>{const t=[...this.#_.entries()],e=it().unix();t.forEach(t=>{const[n,r]=t,{reports:i,...A}=r,o=i.filter(t=>e-t.observationTime<14400);this.#_.set(n,{...A,reports:o})})};dispose=()=>this.#_.clear()}class yu{constructor({fetcher:t}){this.#t=new gu({fetcher:t}),this.#n=new AbortController,this.#r=$({time:500}),this.#i=$({time:6e4}),this.#A={polygon:null,polygonSize:null,isCorridorMode:!1,aircraftCategory:G.C60},this.#o={historyHours:2,maxAltitude:k,minAltitude:R,minSeverity:0}}#A;#o;#t;#n;#a;#u;#r;#i;#c=du();#l;#f;#h;#p=async({isRequiredNewFetch:t})=>{if(this.#a)try{if(this.#t.expire(),t&&this.#A.polygon){this.#u&&(this.#n.abort(fr),this.#n=new AbortController,this.#d(null));const t=this.#t.fetch({config:this.#A,signal:this.#n.signal});this.#d(t),await t}const e=this.#t.getData({config:this.#A,filters:this.#o});this.#l?.(e,this.#c),this.#c=e}catch(t){const e=new Qa("Failed to run Observations flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}finally{this.#d(null),this.#a&&this.#A.polygon&&t&&this.#i.run(this.#p.bind(this,{isRequiredNewFetch:!0}))}};#g=()=>{try{this.#r.cancel(),this.#i.cancel(),this.#a=!1,this.#n.abort(fr),this.#n=new AbortController,this.#d(null)}catch(t){const e=new Qa("Failed to stop Observations flow correctly",{error:t});if(!this.#f)throw e;this.#f(e)}};#d=t=>{this.#u=t,this.#h?.(!!t)};onData=t=>{if(!X({fn:t}))throw new Ba(La);this.#l=t};onError=t=>{if(!X({fn:t}))throw new Ba(La);this.#f=t};onIsProcessingChange=t=>{if(!X({fn:t}))throw new Ba(La);this.#h=t};start=()=>{this.#a=!0,this.#p({isRequiredNewFetch:!0})};stop=()=>this.#g();terminate=()=>{this.#g(),this.#t.dispose()};get isRunning(){return this.#a}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o})=>{if(!H({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some(t=>2!==t.length||t.some(t=>isNaN(Number(t)))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!H({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!H({value:n})){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(G).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!H({value:r})){if("number"!=typeof r)throw new Error("historyHours must be a number");if(![.5,1,2,3,4].includes(r))throw new Error("historyHours must be one of the allowed values, 0.5, 1, 2, 4")}if(!H({value:i})){if("number"!=typeof i)throw new Error("maxAltitude must be a number");if(i<A)throw new Error("maxAltitude must be a higher value than minAltitude");if(i<R||i>k)throw new Error("maxAltitude must be a number between 0 and 52")}if(!H({value:A})){if("number"!=typeof A)throw new Error("minAltitude must be a number");if(A>i)throw new Error("minAltitude must be a lower value than maxAltitude");if(A<R||A>k)throw new Error("minAltitude must be a number between 0 and 52")}if(!H({value:o})){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(o))throw new Error("minSeverity must be a number between 0 and 4")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o});const s={...this.#A},a=Z({current:this.#A,next:{polygon:t,isCorridorMode:e,aircraftCategory:n}});a.has(V)&&(s.isCorridorMode=e),a.has(q)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?O.CORRIDOR:Gn({polygon:t})),a.has(Y)&&(s.aircraftCategory=n),this.#A=s,this.#o=J({current:this.#o,next:{historyHours:r,maxAltitude:i,minAltitude:A,minSeverity:o}});const u=a.size>0;this.#r.run(this.#p.bind(this,{isRequiredNewFetch:u}))}catch(r){const i=new Qa("Failed to update config for ObservationsFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#f)throw i;this.#f(i)}}}const _u="/v5/cache-token";class mu{constructor({fetcher:t}){this.#y=t,this.#i}#y;#i;#Q;#z;#q=!1;#a=!1;#V=!1;#Y=0;#j=()=>Math.min(1e4*2**this.#Y,3e5);#H=({timeToExpireInMs:t})=>{clearTimeout(this.#i);const e=Math.max(0,t);this.#i=setTimeout(()=>{this.#i=null,this.#p()},e)};#p=async()=>{if(this.#a=!0,"undefined"!=typeof navigator&&!navigator.onLine)return this.#H({timeToExpireInMs:this.#j()}),void(this.#Y+=1);try{if(this.#i)return;const t=await this.#y({path:_u});if(t?.networkError)throw new Fa("Network request failed",{path:_u,response:t});if(!t?.data?.token||!t?.data?.expireAt)throw new Fa("Invalid response structure from fetcher",{path:_u,response:t});this.#Q=t.data.token,this.#z=t.data.expireAt,this.#Y=0;const e=it(this.#z).add(5,"second").diff(it(),"milliseconds");this.#H({timeToExpireInMs:e}),this.#q=!0}catch(t){if(this.#H({timeToExpireInMs:this.#j()}),this.#Y+=1,!(t instanceof Fa)){const e=Xa({error:t});new Fa("Failed to get cache token",{path:_u,error:t,errorDetails:e})}}};start=()=>{this.#q||this.#a||this.#p()};stop=()=>{this.#q=!1,this.#a=!1,clearTimeout(this.#i)};getToken=()=>this.#q&&this.#a?(!this.#Q&&this.#q&&new Qa("Token not yet initialized. Ensure start() is called and wait for initial token fetch to complete."),this.#V=it(this.#z).isBefore(it()),this.#V?null:this.#Q):null}return t.CoreUtils=et,t.GeoUtils=Vn,t.Observations=Yn,t.default=async({apiKey:t,userId:e,companyName:n,authCallback:r,environment:i=dr,proxyUrl:A,applicationId:o,isMonitoringEnabled:s=!0,shouldCollectConsoleLogs:a=!1,shouldCollectErrors:u=!1})=>{try{const c=new Ka({environment:i,proxyUrl:A}),{fetcher:l,me:f,config:h}=await c.authenticate({apiKey:t,userId:e,companyName:n,authCallback:r});(({isEnabled:t,collectConsole:e,collectErrors:n,applicationId:r,environment:i,companyId:A,userId:o})=>{t&&i?.toLowerCase()!==hr&&(Ea.init({clientToken:"pub0b945dd1505a74367a4f900219c56210",service:"skypath-web-sdk",site:"datadoghq.com",env:i,version:Ca,forwardErrorsToLogs:n,forwardConsoleLogs:e?"all":[],sessionSampleRate:100,beforeSend:t=>{switch(t.origin){case"logger":{const e=t.logger?.name||"unknown-logger",n={[Ia]:xa.SDK}[e]||`[${e}]`;return t.message=`${n} ${t.message}`,!0}case"network":{const e=t?.http?.status_code;return 0!==e||(t.message=[xa.NETWORK,t.message].join(" ")),!0}default:return!1}}}),Ea.setGlobalContext({applicationId:r,companyId:A,userId:o}),Ea.createLogger(Ia,{level:"info",handler:"http",context:{applicationId:r}}))})({isEnabled:s,collectConsole:a,collectErrors:u,applicationId:o,environment:i,companyId:f?.companyId,userId:f?.userId});const p=new Ya({fetcher:l}),d=await p.getMapping(),g=new mu({fetcher:l}),y=h?.[mr],_=h?.[_r],m=h?.[_r],v=h?.[vr],b=({flag:t})=>`Feature ${t} is not available for user ${f?.userId}`;return{IS_FORECAST_ENABLED:y,IS_ONELAYER_ENABLED:_,IS_ADSB_ENABLED:m,IS_GTG_ENABLED:v,createForecastFlow:()=>{if(!y)throw new Qa(b({flag:mr}));const t=new qa({fetcher:l,isGtg:!1});return new za({service:t,cacheTokenService:g})},createGtgFlow:()=>{if(!v)throw new Qa(b({flag:vr}));const t=new qa({fetcher:l,isGtg:!0});return new za({service:t,cacheTokenService:g})},createObservationsFlow:()=>new yu({fetcher:l}),createOneLayerFlow:()=>{if(!_)throw new Qa(b({flag:_r}));const t=y;return new fu({fetcher:l,cacheTokenService:g,forecastService:t?new qa({fetcher:l,isGtg:!1}):void 0,isForecastActive:t})},createAdsbFlow:()=>{if(!m)throw new Qa(b({flag:_r}));return new ou({fetcher:l})},mapAircraftIcaoToAircraftType:({icao:t})=>j({icao:t,mapping:d})}}catch(t){throw new Ga(t.message,{error:t})}},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|