@skypath-io/web-sdk 0.4.15 → 0.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @skypath-io/web-sdk v0.4.15
2
+ * @skypath-io/web-sdk v0.4.17
3
3
  * SkyPath JavaScript SDK for Web
4
4
  * (c) 2025 SkyPath LTD
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},e=console,n={};Object.keys(t).forEach((t=>{n[t]=e[t]}));const r="Datadog Browser SDK:",A={debug:n.debug.bind(e,r),log:n.log.bind(e,r),info:n.info.bind(e,r),warn:n.warn.bind(e,r),error:n.error.bind(e,r)},i="https://docs.datadoghq.com",o=`${i}/real_user_monitoring/browser/troubleshooting`,s="More details:";function a(t,e){return(...n)=>{try{return t(...n)}catch(t){A.error(e,t)}}}function u(t){return 0!==t&&100*Math.random()<=t}const c=1e3,l=60*c,f=60*l,h=365*(24*f);function p(){return(new Date).getTime()}function d(){return p()}function g(){return performance.now()}function y(){return{relative:g(),timeStamp:d()}}let _;function m(){return void 0===_&&(_=performance.timing.navigationStart),_}const v=1024,E=1024*v,w=/[^\u0000-\u007F]/;function b(t){return w.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function I(t,e){return Object.keys(t).some((n=>t[n]===e))}function C(t){return 0===Object.keys(t).length}function x(){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}function N(t,e){const n=x();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let S,D=!1;function L(t){D=t}function T(t){return function(){return M(t,this,arguments)}}function M(t,e,n){try{return t.apply(e,n)}catch(t){!function(t){if(O(t),S)try{S(t)}catch(t){O(t)}}(t)}}function O(...t){D&&A.error("[MONITOR]",...t)}function R(t,e){return N(x(),"setTimeout")(T(t),e)}function P(t){N(x(),"clearTimeout")(t)}function k(t,e){return N(x(),"setInterval")(T(t),e)}function B(t){N(x(),"clearInterval")(t)}class F{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function G(...t){return new F((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function U(t,e,n){let r,A,i=!1;return{throttled:(...n)=>{i?r=n:(t(...n),i=!0,A=R((()=>{r&&t(...r),i=!1,r=void 0}),e))},cancel:()=>{P(A),i=!1,r=void 0}}}function Q(){}function V(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,V)}const z=/([\w-]+)\s*=\s*([^;]+)/g;function q(t,e,n=""){const r=t.charCodeAt(e-1),A=r>=55296&&r<=56319?e+1:e;return t.length<=A?t:`${t.slice(0,A)}${n}`}function Y(){return 0===(null!=j?j:j=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 j,H,X;function $(t,e,n=0,r){const A=new Date;A.setTime(A.getTime()+n);const i=`expires=${A.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};${i};path=/;samesite=${o}${s}${a}${u}`}function W(t){return function(t,e){for(z.lastIndex=0;;){const n=z.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function K(t){return H||(H=function(t){const e=new Map;for(z.lastIndex=0;;){const n=z.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),H.get(t)}function Z(t,e){$(t,"",0,e)}const J="_dd_s";function tt(t){return Object.values(t)}function et(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function nt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const rt=4*f,At=15*l,it=h,ot={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},st=/^([a-zA-Z]+)=([a-z0-9-]+)$/,at="&";const ut="1";function ct(t,e){const n={isExpired:ut};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function lt(t){return C(t)}function ft(t){return!lt(t)}function ht(t){return void 0!==t.isExpired||!((void 0===(e=t).created||p()-Number(e.created)<rt)&&(void 0===e.expire||p()<Number(e.expire)));var e}function pt(t){t.expire=String(p()+At)}function dt(t){return(e=t,Object.entries(e)).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join(at);var e}function gt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf(at)||st.test(t))}(t)&&t.split(at).forEach((t=>{const n=st.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}const yt="_dd",_t="_dd_r",mt="_dd_l",vt="rum",Et="logs";function wt(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===X){const t=`dd_site_test_${V()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!W(t);)r=`${n.pop()}.${r}`,$(t,e,c,{domain:r});Z(t,{domain:r}),X=r}return X}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${V()}`,n="test";$(e,n,l,t);const r=W(e)===n;return Z(e,t),r}catch(t){return A.error(t),!1}}(e)?{type:ot.COOKIE,cookieOptions:e}:void 0}function bt(t,e){const n={isLockEnabled:Y(),persistSession:(r=e,t=>{$(J,dt(t),At,r)}),retrieveSession:It,expireSession:n=>function(t,e,n){const r=ct(e,n);$(J,dt(r),n.trackAnonymousUser?it:rt,t)}(e,n,t)};var r;return function(t){if(!K(J)){const e=K(yt),n=K(_t),r=K(mt),A={};e&&(A.id=e),r&&/^[01]$/.test(r)&&(A[Et]=r),n&&/^[012]$/.test(n)&&(A[vt]=n),ft(A)&&(pt(A),t.persistSession(A))}}(n),n}function It(){return gt(W(J))}const Ct="_dd_test_";function xt(){try{const t=V(),e=`${Ct}${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:ot.LOCAL_STORAGE}:void 0}catch(t){return}}function Nt(t){return{isLockEnabled:!1,persistSession:St,retrieveSession:Dt,expireSession:e=>function(t,e){St(ct(t,e))}(e,t)}}function St(t){localStorage.setItem(J,dt(t))}function Dt(){return gt(localStorage.getItem(J))}const Lt=10,Tt=100,Mt=[];let Ot;function Rt(t,e,n=0){var r;const{isLockEnabled:A,persistSession:i,expireSession:o}=e,s=t=>i({...t,lock:u}),a=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Ot||(Ot=t),t!==Ot)return void Mt.push(t);if(A&&n>=Tt)return void kt(e);let u,c=a();if(A){if(c.lock)return void Pt(t,e,n);if(u=V(),s(c.session),c=a(),c.lock!==u)return void Pt(t,e,n)}let l=t.process(c.session);if(A&&(c=a(),c.lock!==u))Pt(t,e,n);else{if(l&&(ht(l)?o(l):(pt(l),A?s(l):i(l))),A&&(!l||!ht(l))){if(c=a(),c.lock!==u)return void Pt(t,e,n);i(c.session),l=c.session}null===(r=t.after)||void 0===r||r.call(t,l||c.session),kt(e)}}function Pt(t,e,n){R((()=>{Rt(t,e,n+1)}),Lt)}function kt(t){Ot=void 0;const e=Mt.shift();e&&Rt(e,t)}const Bt=c;function Ft(t){switch(t.sessionPersistence){case ot.COOKIE:return wt(t);case ot.LOCAL_STORAGE:return xt();case void 0:{let e=wt(t);return!e&&t.allowFallbackToLocalStorage&&(e=xt()),e}default:A.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Gt(t,e,n,r){const A=new F,i=new F,o=new F,s=t.type===ot.COOKIE?bt(e,t.cookieOptions):Nt(e),{expireSession:a}=s,u=k((function(){Rt({process:t=>ht(t)?ct(t,e):void 0,after:h},s)}),Bt);let c;d();const{throttled:l,cancel:f}=U((()=>{Rt({process:t=>{if(lt(t))return;const e=h(t);return function(t){if(lt(t))return!1;const{trackingType:e,isTracked:A}=r(t[n]);t[n]=e,delete t.isExpired,A&&!t.id&&(t.id=V(),t.created=String(p()))}(e),e},after:t=>{ft(t)&&!g()&&function(t){c=t,A.notify()}(t),c=t}},s)}),Bt);function h(t){return ht(t)&&(t=ct(t,e)),g()&&(!function(t){return c.id!==t.id||c[n]!==t[n]}(t)?(o.notify({previousState:c,newState:t}),c=t):(c=ct(c,e),i.notify())),t}function d(){Rt({process:t=>{if(lt(t))return ct(t,e)},after:t=>{c=t}},s)}function g(){return void 0!==c[n]}return{expandOrRenewSession:l,expandSession:function(){Rt({process:t=>g()?h(t):void 0},s)},getSession:()=>c,renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o,restartSession:d,expire:()=>{f(),a(c),h(ct(c,e))},stop:()=>{B(u)},updateSessionState:function(t){Rt({process:e=>({...e,...t}),after:h},s)}}}const Ut={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Qt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=Vt(Object.prototype),A=Vt(Array.prototype),i=Vt(Object.getPrototypeOf(t)),o=Vt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),A(),i(),o()}}function Vt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):Q}function zt(t){return function(t,e){const n=function(){if(void 0===Yt)try{const t=new qt("http://test/path");Yt="http://test/path"===t.href}catch(t){Yt=!1}return Yt?qt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${Qt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const A=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(A)}return A.href=t,A}(t,location.href).href}const qt=URL;let Yt;const jt="datad0g.com",Ht="dd0g-gov.com",Xt="datadoghq.com",$t="pci.browser-intake-datadoghq.com",Wt=["ddsource","ddtags"];function Kt(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=zt(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const A=function(t,e){const{site:n=Xt,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===Xt)return $t;if(r&&n===Xt)return`${r}.${Xt}`;if(n===Ht)return`http-intake.logs.${n}`;const A=n.split("."),i=A.pop();return`browser-intake-${A.join("-")}.${i}`}(e,t);return t=>`https://${A}${n}?${t}`}(t,e);return{build(A,i){const o=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,A,{retry:i,encoding:o}){const s=["sdk_version:6.0.0",`api:${A}`].concat(r);i&&s.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const a=["ddsource=browser",`ddtags=${encodeURIComponent(s.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${V()}`];o&&a.push(`dd-evp-encoding=${o}`);"rum"===n&&a.push(`batch_time=${d()}`);e&&a.reverse();return a.join("&")}(t,e,n,A,i);return r(o)},urlPrefix:r(""),trackType:e}}const Zt=200;function Jt(t,e){const n=Zt-t.length-1;(e.length>n||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)}(e))&&A.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${s} ${i}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function te(t){const e=t.site||Xt,n=function(t){const{env:e,service:n,version:r,datacenter:A}=t,i=[];return e&&i.push(Jt("env",e)),n&&i.push(Jt("service",n)),r&&i.push(Jt("version",r)),A&&i.push(Jt("datacenter",A)),i}(t),r=function(t,e){return{logsEndpointBuilder:Kt(t,"logs",e),rumEndpointBuilder:Kt(t,"rum",e),sessionReplayEndpointBuilder:Kt(t,"replay",e)}}(t,n),A=function(t,e){if(!t.replica)return;const n={...t,site:Xt,clientToken:t.replica.clientToken},r={logsEndpointBuilder:Kt(n,"logs",e),rumEndpointBuilder:Kt(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:A,site:e,...r}}function ee(t,e){return null==t||"string"==typeof t||(A.error(`${e} must be defined as a string`),!1)}function ne(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(A.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function re(t){var e,n,r,o,u,l;if(t&&t.clientToken){if((!(f=t.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(A.error(`Site should be a valid Datadog site. ${s} ${i}/getting_started/site/.`),0))&&ne(t.sessionSampleRate,"Session")&&ne(t.telemetrySampleRate,"Telemetry")&&ne(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&ne(t.telemetryUsageSampleRate,"Telemetry Usage")&&ee(t.version,"Version")&&ee(t.env,"Env")&&ee(t.service,"Service")){var f;if(void 0===t.trackingConsent||I(Ut,t.trackingConsent))return{beforeSend:t.beforeSend&&a(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Ft(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(o=t.telemetryUsageSampleRate)&&void 0!==o?o:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(u=t.trackingConsent)&&void 0!==u?u:Ut.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16*v,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*c,batchMessagesLimit:50,messageBytesLimit:256*v,...te(t)};A.error('Tracking Consent should be either "granted" or "not-granted"')}}else A.error("Client Token is not configured, we will not send any data.")}var Ae;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(Ae||(Ae={}));const ie=new Set;function oe(t){Array.isArray(t)&&t.filter((t=>I(Ae,t))).forEach((t=>{ie.add(t)}))}function se(){return ie}const ae="?";function ue(t){const e=[];let n=_e(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=fe.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),A=he.exec(e[2]);r&&A&&(e[2]=A[1],e[3]=A[2],e[4]=A[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||ae,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=pe.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:ae,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=de.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||ae,line:+e[3],url:e[2]}}(t)||function(t){const e=ge.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=ye.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]||ae,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=ae),e.push(n))})),{message:_e(t,"message"),name:_e(t,"name"),stack:e}}const ce="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",le="(?::(\\d+))",fe=new RegExp(`^\\s*at (.*?) ?\\(${ce}${le}?${le}?\\)?\\s*$`,"i"),he=new RegExp(`\\((\\S*)${le}${le}\\)`);const pe=new RegExp(`^\\s*at ?${ce}${le}?${le}??\\s*$`,"i");const de=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const ge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ye=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function _e(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function me(t,e,n,r){const A=[{url:e,column:r,line:n}],{name:i,message:o}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=ve.exec(t));return{name:e,message:n}}(t);return{name:i,message:o,stack:A}}const ve=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Ee(){const t=new Error;let e;return M((()=>{const n=ue(t);n.stack=n.stack.slice(2),e=we(n)})),e}function we(t){let e=be(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",A=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${A}${i}`})),e}function be(t){return`${t.name||"Error"}: ${t.message}`}function Ie(t,e,n,{computeHandlingStack:r}={}){let A=t[e];if("function"!=typeof A){if(!(e in t)||!e.startsWith("on"))return{stop:Q};A=Q}let i=!1;const o=function(){if(i)return A.apply(this,arguments);const t=Array.from(arguments);let e;M(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Ee():void 0}]);const o=A.apply(this,t);return e&&M(e,null,[o]),o};return t[e]=o,{stop:()=>{i=!0,t[e]===o&&(t[e]=A)}}}const Ce=220*v,xe="$",Ne=3;function Se(t,e=Ce){const n=Vt(Object.prototype),r=Vt(Array.prototype),A=[],i=new WeakMap,o=De(t,xe,void 0,A,i),s=JSON.stringify(o);let a=s?s.length:0;if(!(a>e)){for(;A.length>0&&a<e;){const n=A.shift();let r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){const s=De(n.source[o],n.path,o,A,i);if(a+=void 0!==s?JSON.stringify(s).length:4,a+=r,r=1,a>e){Te(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=De(n.source[o],n.path,o,A,i);if(void 0!==s&&(a+=JSON.stringify(s).length+r+o.length+Ne,r=1),a>e){Te(e,"truncated",t);break}n.target[o]=s}}return n(),r(),o}Te(e,"discarded",t)}function De(t,e,n,r,A){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)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}(i);const o=Le(i);if("[Object]"!==o&&"[Array]"!==o&&"[Error]"!==o)return o;const s=t;if(A.has(s))return`[Reference seen at ${A.get(s)}]`;const a=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return A.set(s,a),r.push({source:i,target:u,path:a}),u}function Le(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Le(e.currentTarget):null,target:e.target?Le(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 Te(t,e,n){A.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Me="No stack, consider using an instance of Error";function Oe({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:A,source:i,handling:o}){const s=Pe(e),a=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${Qt(Se(r))}`}(t,s,A,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(s,t)?we(t):Me,c=s?ke(e,i):void 0;return{startClocks:r,source:i,handling:o,handlingStack:n,originalError:e,type:t?t.name:void 0,message:a,stack:u,causes:c,fingerprint:Re(e)}}function Re(t){return Pe(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function Pe(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function ke(t,e){let n=t;const r=[];for(;Pe(null==n?void 0:n.cause)&&r.length<10;){const t=ue(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&we(t)}),n=n.cause}return r.length?r:void 0}const Be={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Fe(t){const e=(e,n)=>{const r=Oe({stackTrace:e,originalError:n,startClocks:y(),nonErrorPrefix:"Uncaught",source:Be.SOURCE,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ie(window,"onerror",(({parameters:[t,e,n,A,i]})=>{let o;o=Pe(i)?ue(i):me(t,e,n,A),r(o,null!=i?i:t)})));var r;const{stop:A}=function(t){return Ie(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=ue(n);t(r,n)}))}(e);return{stop:()=>{n(),A()}}}function Ge(t,e){e.silentMultipleInit||A.error(`${t} is already initialized.`)}function Ue(t,e,n,r,A){return Qe(t,e,[n],r,A)}function Qe(t,e,n,r,{once:A,capture:i,passive:o}={}){const s=T((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(A&&l(),r(e))})),a=o?{capture:i,passive:o}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,c=N(u,"addEventListener");function l(){const t=N(u,"removeEventListener");n.forEach((n=>t.call(e,n,s,a)))}return n.forEach((t=>c.call(e,t,s,a))),{stop:l}}const Ve={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function ze(t,e){const n=[];e.includes(Ve.cspViolation)&&n.push(function(t){return new F((e=>{const{stop:n}=Ue(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return qe({type:t.effectiveDirective,message:`${Ve.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:Ye(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${q(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Ve.cspViolation));return r.length&&n.push(function(t){return new F((e=>{if(!window.ReportingObserver)return;const n=T(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return qe({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:Ye(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)),G(...n)}function qe(t){return{startClocks:y(),source:Be.REPORT,handling:"unhandled",...t}}function Ye(t,e,n,r,A){return n?we({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=A?A:void 0}]}):void 0}function je(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function He(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]=He(r[t],e[t],n);return r}const r="object"===et(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=He(r[t],e[t],n));return r}function Xe(t){return He(void 0,t)}function $e(...t){let e;for(const n of t)null!=n&&(e=He(e,n));return e}function We(){var t;const e=window.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 Ke(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const Ze=500;function Je(){const t=[];return{add:e=>{t.push(e)>Ze&&t.splice(0,1)},remove:e=>{Ke(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const tn={log:"log",configuration:"configuration",usage:"usage"},en=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],nn=["ddog-gov.com"];let rn=Je(),An=t=>{rn.add((()=>An(t)))};function on(t,e){let n;const r=new F,A=new Set,i=!nn.includes(e.site)&&u(e.telemetrySampleRate),o={[tn.log]:i,[tn.configuration]:i&&u(e.telemetryConfigurationSampleRate),[tn.usage]:i&&u(e.telemetryUsageSampleRate)},s={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return An=i=>{const a=Qt(i);if(o[i.type]&&A.size<e.maxTelemetryEventsPerPage&&!A.has(a)){const e=function(t,e,r){return $e({type:"telemetry",date:d(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:$e(e,{runtime_env:r,connectivity:We(),sdk_setup:"npm"}),experimental_features:Array.from(se())},void 0!==n?n():{})}(t,i,s);r.notify(e),je("telemetry",e),A.add(a)}},S=an,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function sn(e,n){O(t.debug,e,n),An({type:tn.log,message:e,status:"debug",...n})}function an(t,e){An({type:tn.log,status:"error",...un(t),...e})}function un(t){if(Pe(t)){const e=ue(t);return{error:{kind:e.name,stack:we(cn(e))},message:e.message}}return{error:{stack:Me},message:`Uncaught ${Qt(t)}`}}function cn(t){return t.stack=t.stack.filter((t=>!t.url||en.some((e=>t.url.startsWith(e))))),t}const ln=1/0,fn=l;function hn({expireDelay:t,maxEntries:e}){let n=[];const r=k((()=>function(){const e=g()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),fn);return{add:function(t,r){const A={value:t,startTime:r,endTime:ln,remove:()=>{Ke(n,A)},close:t=>{A.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(A),A},find:function(t=ln,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===ln&&e.close(t)},findAll:function(t=ln,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(){B(r)}}}const pn=l,dn=rt;function gn(t,e,n,r){const A=new F,i=new F,o=Gt(t.sessionStoreStrategyType,t,e,n),s=hn({expireDelay:dn});function a(){return{id:o.getSession().id,trackingType:o.getSession()[e],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return o.renewObservable.subscribe((()=>{s.add(a(),g()),A.notify()})),o.expireObservable.subscribe((()=>{i.notify(),s.closeActive(g())})),o.expandOrRenewSession(),s.add(a(),[0,m()][0]),r.observable.subscribe((()=>{r.isGranted()?o.expandOrRenewSession():o.expire()})),function(t,e){Qe(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()};Ue(t,document,"visibilitychange",n),k(n,pn)}(t,(()=>o.expandSession())),function(t,e){Ue(t,window,"resume",e,{capture:!0})}(t,(()=>o.restartSession())),{findSession:(t,e)=>s.find(t,e),renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function yn(t){return t>=500}const _n=80*v,mn=32,vn=3*E,En=l,wn=c;function bn(t,e,n,r,A){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Cn(t,e,n,{onSuccess:()=>xn(0,e,n,r,A),onFailure:()=>{e.queuedPayloads.enqueue(t),In(e,n,r,A)}}):e.queuedPayloads.enqueue(t)}function In(t,e,n,r){2===t.transportStatus&&R((()=>{Cn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=wn,xn(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(En,2*t.currentBackoffTime),In(t,e,n,r)}})}),t.currentBackoffTime)}function Cn(t,e,n,{onSuccess:r,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||yn(t.status))}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},A())}))}function xn(t,e,n,r,A){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(A({message:`Reached max ${r} events size queued for upload: ${vn/E}MiB`,source:Be.AGENT,startClocks:y()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Nn();i.size()>0;)bn(i.dequeue(),e,n,r,A)}function Nn(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=vn}}}function Sn(t,e,n){const r={transportStatus:0,currentBackoffTime:wn,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=_n&&this.ongoingRequestCount<mn},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Nn(),queueFullReported:!1},A=(n,r)=>function(t,e,n,r){const A=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(A){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(T((t=>null==r?void 0:r({status:t.status,type:t.type}))),T((()=>{Ln(t.build("xhr",n),n.data,r)})))}else{Ln(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{bn(e,r,A,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Dn||(Dn=!0,an(t))}(t)}const A=t.build("xhr",n);Ln(A,n.data)}(t,e,n)}}}let Dn=!1;function Ln(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Ue({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Tn(){const t=x().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 A=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:A}))}}}function Mn(t){var e;void 0===t&&(t=null===(e=x().location)||void 0===e?void 0:e.hostname);const n=Tn();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const On={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Rn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let i={};const a=n.flushObservable.subscribe((n=>function(n){const r=tt(i).join("\n");i={};const A=(s=n.reason,tt(On).includes(s)),o=A?e.sendOnExit:e.send;var s;if(A&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&o(Pn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&o({data:n,bytesCount:b(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{o(Pn(t))}))}(n)));function u(e,a){const u=Qt(e),c=t.estimateEncodedBytesCount(u);c>=r?A.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${s} ${o}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==i[t]}(a)&&function(e){const r=i[e];delete i[e];const A=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(A)}(a),function(e,r,A){n.notifyBeforeAddMessage(r),void 0!==A?(i[A]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,c,a))}return{flushController:n,add:u,upsert:u,stop:a.unsubscribe}}function Pn(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}}function kn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:A}){const i=r.subscribe((t=>l(t.reason))),o=A.subscribe((()=>l("session_expire"))),s=new F((()=>()=>{i.unsubscribe(),o.unsubscribe()}));let a,u=0,c=0;function l(t){if(0===c)return;const e=c,n=u;c=0,u=0,f(),s.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){P(a),a=void 0}return{flushObservable:s,get messagesCount(){return c},notifyBeforeAddMessage(t){u+t>=e&&l("bytes_limit"),c+=1,u+=t,void 0===a&&(a=R((()=>{l("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,c>=t?l("messages_limit"):u>=e&&l("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,c-=1,0===c&&f()}}}function Bn(t,e,n,r,A,i,o=Rn){const s=u(t,e),a=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return o({encoder:n,request:Sn(e,t.batchBytesLimit,r),flushController:kn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:A,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add(t,e=!0){s.add(t),a&&e&&a.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{s.upsert(t,e),a&&a.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{s.stop(),a&&a.stop()}}}function Fn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const A=b(n);e+=A,t+=n,r&&r(A)},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 Gn;const Un=new WeakMap;function Qn(t){return Gn||(Gn=function(t){return new F((e=>{const{stop:n}=Ie(XMLHttpRequest.prototype,"open",Vn),{stop:r}=Ie(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const A=Un.get(t);if(!A)return;const i=A;i.state="start",i.startClocks=y(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let o=!1;const{stop:s}=Ie(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&a()})),a=()=>{if(u(),s(),o)return;o=!0;const e=A;var n,a;e.state="complete",e.duration=(n=i.startClocks.timeStamp,d()-n),e.status=t.status,r.notify((a=e,{...a}))},{stop:u}=Ue(n,t,"loadend",a);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:A}=Ie(XMLHttpRequest.prototype,"abort",zn);return()=>{n(),r(),A()}}))}(t)),Gn}function Vn({target:t,parameters:[e,n]}){Un.set(t,{state:"open",method:String(e).toUpperCase(),url:zt(String(n))})}function zn({target:t}){const e=Un.get(t);e&&(e.isAborted=!0)}let qn;function Yn(){return qn||(qn=new F((t=>{if(!window.fetch)return;const{stop:e}=Ie(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[A,i]=t;let o=i&&i.method;void 0===o&&A instanceof Request&&(o=A.method);const s=void 0!==o?String(o).toUpperCase():"GET",a=A instanceof Request?A.url:zt(String(A)),u=y(),c={state:"start",init:i,input:A,method:s,startClocks:u,url:a,handlingStack:n};r.notify(c),t[0]=c.input,t[1]=c.init,e((t=>function(t,e,n){const r=n;function A(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(T((t=>{A({response:t,responseType:t.type,status:t.status,isAborted:!1})})),T((t=>{var e,n;A({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,c)))}(e,t)),{computeHandlingStack:!0});return e}))),qn}let jn={};function Hn(n){return G(...n.map((n=>(jn[n]||(jn[n]=function(n){return new F((r=>{const A=e[n];return e[n]=(...e)=>{A.apply(console,e);const i=Ee();M((()=>{r.notify(function(e,n,r){const A=e.map((t=>function(t){if("string"==typeof t)return Se(t);if(Pe(t))return be(ue(t));return Qt(Se(t),void 0,2)}(t))).join(" ");let i;if(n===t.error){const t=e.find(Pe);i={stack:t?we(ue(t)):void 0,fingerprint:Re(t),causes:t?ke(t,"console"):void 0,startClocks:y(),message:A,source:Be.CONSOLE,handling:"handled",handlingStack:r}}return{api:n,message:A,error:i,handlingStack:r}}(e,n,i))}))},()=>{e[n]=A}}))}(n)),jn[n]))))}function Xn(t){let e={};const n=new F,r={getContext:()=>Xe(e),setContext:A=>{"object"===et(A)?(e=Se(A),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,A)=>{e[r]=Se(A),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const $n="_dd_c",Wn=[];function Kn(t,e,n,r){const A=function(t,e){return`${$n}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(A);return null!==t?JSON.parse(t):{}}Wn.push(Ue(t,window,"storage",(({key:t})=>{A===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(A,JSON.stringify(e.getContext()))})),e.setContext($e(i(),e.getContext()))}const Zn=3*v,Jn=16*v,tr=200;function er(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const i=2===t?Zn:Jn;let a=r;e.forEach((t=>{a+=t.getBytesCount()})),a>i&&(!function(t){A.warn(`Customer data exceeds the recommended ${t/v}KiB threshold. ${s} ${o}/#customer-data-exceeds-the-recommended-threshold-warning`)}(i),n=!0)}return{createDetachedTracker:()=>{const t=nr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,nr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function nr(t){let e=0;const{throttled:n,cancel:r}=U((n=>{e=b(Qt(n)),t()}),tr),A=()=>{r(),e=0};return{updateCustomerData:t=>{C(t)?A():n(t)},resetCustomerData:A,getBytesCount:()=>e,stop:()=>{r()}}}const rr="datadog-synthetics-public-id",Ar="datadog-synthetics-result-id",ir="datadog-synthetics-injects-rum";function or(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||K(ir))}function sr(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||K(rr);return"string"==typeof t?t:void 0}function ar(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||K(Ar);return"string"==typeof t?t:void 0}function ur(t,e,n){const r=n.getHandler(),A=Array.isArray(r)?r:[r];return lr[t]>=lr[n.getLevel()]&&A.includes(e)}const cr={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},lr={[cr.ok]:0,[cr.debug]:1,[cr.info]:2,[cr.notice]:4,[cr.warn]:5,[cr.error]:6,[cr.critical]:7,[cr.alert]:8,[cr.emerg]:9};function fr(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 hr=function(t,e,n,r){var A,i=arguments.length,o=i<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--)(A=t[s])&&(o=(i<3?A(o):i>3?A(e,n,o):A(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const pr={console:"console",http:"http",silent:"silent"},dr=Object.keys(cr);class gr{constructor(t,e,n,r=pr.http,A=cr.debug,i={}){this.handleLogStrategy=t,this.handlerType=r,this.level=A,this.contextManager=Xn(e),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}logImplementation(t,e,n=cr.info,r,A){const i=Se(e);let o;if(null!=r){o=$e({error:fr(Oe({stackTrace:Pe(r)?ue(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Be.LOGGER,handling:"handled",startClocks:y()}),{includeMessage:!0})},i)}else o=i;this.handleLogStrategy({message:Se(t),context:o,status:n},this,A)}log(t,e,n=cr.info,r){let A;ur(n,pr.http,this)&&(A=Ee()),this.logImplementation(t,e,n,r,A)}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()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function yr(t){return function(e,n,r){let A;ur(t,pr.http,this)&&(A=Ee()),this.logImplementation(e,n,t,r,A)}}hr([function(t,e,n){const r=n.value;n.value=function(...t){return(S?T(r):r).apply(this,t)}}],gr.prototype,"logImplementation",null),gr.prototype.ok=yr(cr.ok),gr.prototype.debug=yr(cr.debug),gr.prototype.info=yr(cr.info),gr.prototype.notice=yr(cr.notice),gr.prototype.warn=yr(cr.warn),gr.prototype.error=yr(cr.error),gr.prototype.critical=yr(cr.critical),gr.prototype.alert=yr(cr.alert),gr.prototype.emerg=yr(cr.emerg);const _r=32*v;function mr(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 A.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function vr(e,n,r){const i=Je();let o,s;const a=n.observable.subscribe(u);function u(){if(!s||!o||!n.isGranted())return;a.unsubscribe();const t=r(o,s);i.drain(t)}return{init(e){if(!e)return void A.error("Missing configuration");if(oe(e.enableExperimentalFeatures),Mn()&&(e=function(t){return{...t,clientToken:"empty"}}(e)),o=e,s)return void Ge("DD_LOGS",e);const r=function(e){!0===e.usePciIntake&&e.site&&"datadoghq.com"!==e.site&&A.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=re(e),r=mr(e.forwardConsoleLogs,tt(t),"Forward Console Logs"),i=mr(e.forwardReports,tt(Ve),"Forward Reports");if(n&&r&&i)return e.forwardErrorsToLogs&&!r.includes(t.error)&&r.push(t.error),{forwardErrorsToLogs:!1!==e.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:_r,...n}}(e);r&&(s=r,Yn().subscribe(Q),n.tryToInit(r.trackingConsent),u())},get initConfiguration(){return o},getInternalContext:Q,handleLog(t,n,r,A=e(),o=d()){i.add((e=>e.handleLog(t,n,r,A,o)))}}}const Er="logs";const wr="logs";function br(t,e){const n=gn(t,wr,(e=>function(t,e){const n=function(t){return"0"===t||"1"===t}(e)?e:Ir(t);return{trackingType:n,isTracked:"1"===n}}(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}}function Ir(t){return u(t.sessionSampleRate)?"1":"0"}let Cr=!1;function xr(t){const e=window;if(or()){const t=n(e.DD_RUM_SYNTHETICS);return t||Cr||(Cr=!0,sn("Logs sent before RUM is injected by the synthetics worker",{testId:sr(),resultId:ar()})),t}return n(e.DD_RUM);function n(e){if(e&&e.getInternalContext)return e.getInternalContext(t)}}function Nr(t,e,n,r,A){const i=dr.concat(["custom"]),o={};i.forEach((t=>{o[t]=function(t,e,n){let r=0,A=!1;return{isLimitReached(){if(0===r&&R((()=>{r=0}),l),r+=1,r<=e||A)return A=!1,!1;if(r===e+1){A=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Be.AGENT,startClocks:y()})}finally{A=!1}}return!0}}}(t,e.eventRateLimiterThreshold,A)})),n.subscribe(0,(({rawLogsEvent:A,messageContext:i,savedCommonContext:s,domainContext:a})=>{var u,c;const l=A.date-m();const f=t.findTrackedSession(l);if(!t.findTrackedSession(l,{returnInactive:!0}))return;const h=s||r();f&&f.anonymousId&&!h.user.anonymous_id&&(h.user.anonymous_id=f.anonymousId);const p=$e({service:e.service,session_id:f?f.id:void 0,session:f?{id:f.id}:void 0,usr:C(h.user)?void 0:h.user,view:h.view},h.context,xr(l),A,i);!1===(null===(u=e.beforeSend)||void 0===u?void 0:u.call(e,p,a))||p.origin!==Be.AGENT&&(null!==(c=o[p.status])&&void 0!==c?c:o.custom).isLimitReached()||n.notify(1,p)}))}const Sr={[t.log]:cr.info,[t.debug]:cr.debug,[t.info]:cr.info,[t.warn]:cr.warn,[t.error]:cr.error};function Dr(t,e){if(!t.forwardErrorsToLogs)return{stop:Q};const n=Qn(t).subscribe((t=>{"complete"===t.state&&A("xhr",t)})),r=Yn().subscribe((t=>{"resolve"===t.state&&A("fetch",t)}));function A(n,r){var A;function i(t){const A={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${Tr(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:t||"Failed to load",handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:cr.error,origin:Be.NETWORK},domainContext:A})}A=r.url,Wt.every((t=>A.includes(t)))||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!yn(r.status)||("xhr"in r?function(t,e,n){"string"==typeof t.response?n(Lr(t.response,e)):n(t.response)}(r.xhr,t,i):r.response?function(t,e,n){const r=function(t){try{return t.clone()}catch(t){return}}(t);r&&r.body?window.TextDecoder?function(t,e,n){!function(t,e,n){const r=t.getReader(),A=[];let i=0;function o(){let t,o;r.cancel().catch(Q);{let e;if(1===A.length)e=A[0];else{e=new Uint8Array(i);let t=0;A.forEach((n=>{e.set(n,t),t+=n.length}))}t=e.slice(0,n.bytesLimit),o=e.length>n.bytesLimit}e(void 0,t,o)}!function t(){r.read().then(T((e=>{e.done?o():(A.push(e.value),i+=e.value.length,i>n.bytesLimit?o():t())})),T((t=>e(t))))}()}(t,((t,e,r)=>{if(t)n(t);else{let t=(new TextDecoder).decode(e);r&&(t+="..."),n(void 0,t)}}),{bytesLimit:e,collectStreamBody:!0})}(r.body,e.requestErrorResponseLengthLimit,((t,e)=>{n(t?`Unable to retrieve response: ${t}`:e)})):r.text().then(T((t=>n(Lr(t,e)))),T((t=>n(`Unable to retrieve response: ${t}`)))):n()}(r.response,t,i):r.error&&function(t,e,n){n(Lr(we(ue(t)),e))}(r.error,t,i))}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function Lr(t,e){return t.length>e.requestErrorResponseLengthLimit?`${t.substring(0,e.requestErrorResponseLengthLimit)}...`:t}function Tr(t){return"xhr"===t?"XHR":"Fetch"}const Mr=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 Or(t){return{handleLog:function(r,A,i,o,s){const a=$e(A.getContext(),r.context);if(ur(r.status,pr.console,A)&&function({status:t,message:r},A){n[Rr[t]].call(e,r,A)}(r,a),ur(r.status,pr.http,A)){const e={rawLogsEvent:{date:s||d(),message:r.message,status:r.status,origin:Be.LOGGER},messageContext:a,savedCommonContext:o};i&&(e.domainContext={handlingStack:i}),t.notify(0,e)}}}}const Rr={[cr.ok]:t.debug,[cr.debug]:t.debug,[cr.info]:t.info,[cr.notice]:t.info,[cr.warn]:t.warn,[cr.error]:t.error,[cr.critical]:t.error,[cr.alert]:t.error,[cr.emerg]:t.error};function Pr(t,e,n,r,A){const i=on("browser-logs-sdk",e);i.setContextProvider((()=>{var t,e,n,r,i,o;return{application:{id:null===(t=xr())||void 0===t?void 0:t.application_id},session:{id:null===(e=A.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(r=null===(n=xr())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(o=null===(i=xr())||void 0===i?void 0:i.user_action)||void 0===o?void 0:o.id}}}));const o=[];if(Mn()){const t=Tn(),e=i.observable.subscribe((e=>t.send("internal_telemetry",e)));o.push((()=>e.unsubscribe()))}else{const t=Bn(e,{endpoint:e.rumEndpointBuilder,encoder:Fn()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:Fn()},n,r,A.expireObservable);o.push((()=>t.stop()));const s=i.observable.subscribe((n=>t.add(n,function(t){return t.site===jt}(e))));o.push((()=>s.unsubscribe()))}return rn.drain(),function(t){An({type:tn.configuration,configuration:t})}(function(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};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}(t)),{telemetry:i,stop:()=>{o.forEach((t=>t()))}}}const kr=function(t){const e=er(),n=Xn(e.getOrCreateTracker(2)),r=Xn(e.getOrCreateTracker(1)),i=function(t){const e=new F;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Ut.GRANTED,observable:e}}();function o(){return function(t,e){return{view:{referrer:document.referrer,url:window.location.href},context:t.getContext(),user:e.getContext()}}(n,r)}let s=vr(o,i,((e,A)=>{e.storeContextsAcrossPages&&(Kn(A,n,Er,2),Kn(A,r,Er,1));const a=t(e,A,o,i);return s=function(t,e){return{init:t=>{Ge("DD_LOGS",t)},initConfiguration:t,...e}}(e,a),a}));const a={};return function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>L,enumerable:!1}),e}({logger:new gr(((...t)=>s.handleLog(...t)),e.createDetachedTracker()),init:T((t=>s.init(t))),setTrackingConsent:T((t=>{var e;i.update(t),e={feature:"set-tracking-consent",tracking_consent:t},An({type:tn.usage,usage:e})})),getGlobalContext:T((()=>n.getContext())),setGlobalContext:T((t=>n.setContext(t))),setGlobalContextProperty:T(((t,e)=>n.setContextProperty(t,e))),removeGlobalContextProperty:T((t=>n.removeContextProperty(t))),clearGlobalContext:T((()=>n.clearContext())),createLogger:T(((t,n={})=>(a[t]=new gr(((...t)=>s.handleLog(...t)),e.createDetachedTracker(),Se(t),n.handler,n.level,Se(n.context)),a[t]))),getLogger:T((t=>a[t])),getInitConfiguration:T((()=>Xe(s.initConfiguration))),getInternalContext:T((t=>s.getInternalContext(t))),setUser:T((t=>{(function(t){const e="object"===et(t);return e||A.error("Unsupported user:",t),e})(t)&&r.setContext(nt(t))})),getUser:T((()=>r.getContext())),setUserProperty:T(((t,e)=>{const n=nt({[t]:e})[t];r.setContextProperty(t,n)})),removeUserProperty:T((t=>r.removeContextProperty(t))),clearUser:T((()=>r.clearContext()))})}((function(t,e,n,r){const A=new Mr,i=[];A.subscribe(1,(t=>je("logs",t)));const o=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Be.AGENT,status:cr.error}}),sn("Error reported to customer",{"error.message":e.message})}}(A),s=function(t){return new F((e=>{const{stop:n}=Qe(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:On.HIDDEN}):"freeze"===t.type&&e.notify({reason:On.FROZEN})}),{capture:!0}),r=Ue(t,window,"beforeunload",(()=>{e.notify({reason:On.UNLOADING})})).stop;return()=>{n(),r()}}))}(e),a=!e.sessionStoreStrategyType||Mn()||or()?function(t){const e="1"===Ir(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new F}}(e):br(e,r),{stop:u}=Pr(t,e,o,s,a);i.push((()=>u())),Dr(e,A),function(t,e){if(!t.forwardErrorsToLogs)return{stop:Q};const n=new F,{stop:r}=Fe(n),A=n.subscribe((t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,error:fr(t),origin:Be.SOURCE,status:cr.error}})}))}(e,A),function(t,e){const n=Hn(t.forwardConsoleLogs).subscribe((t=>{const n={rawLogsEvent:{date:d(),message:t.message,origin:Be.CONSOLE,error:t.error&&fr(t.error),status:Sr[t.api]},domainContext:{handlingStack:t.handlingStack}};e.notify(0,n)}))}(e,A),function(t,e){const n=ze(t,t.forwardReports).subscribe((t=>{let n,r=t.message;const A="deprecation"===t.originalError.type?cr.warn:cr.error;var i,o;A===cr.error?n=fr(t):t.stack&&(r+=` Found in ${i=t.stack,null===(o=/@ (.+)/.exec(i))||void 0===o?void 0:o[1]}`),e.notify(0,{rawLogsEvent:{date:d(),message:r,origin:Be.REPORT,error:n,status:A}})}))}(e,A);const{handleLog:c}=Or(A);if(Nr(a,e,A,n,o),Mn())!function(t){const e=Tn();t.subscribe(1,(t=>{e.send("log",t)}))}(A);else{const{stop:t}=function(t,e,n,r,A){const i=Bn(t,{endpoint:t.logsEndpointBuilder,encoder:Fn()},t.replica&&{endpoint:t.replica.logsEndpointBuilder,encoder:Fn()},n,r,A.expireObservable);return e.subscribe(1,(t=>{i.add(t)})),i}(e,A,o,s,a);i.push((()=>t()))}var l;return{handleLog:c,getInternalContext:(l=a,{get:t=>{const e=l.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,stop:()=>{i.forEach((t=>t()))}}}));!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&A.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=>a(t,"onReady callback threw an error:")()))}(x(),"DD_LOGS",kr);const Br="GET",Fr="POST",Gr="x-api-key",Ur="x-access-token",Qr="content-type",Vr="/v4/partner-login",zr="/v4/partner-login-signed",qr="/v4/partner-refresh-token",Yr="/v5/users/me",jr="[SkyPath SDK]: Old fetch request aborted",Hr="local",Xr="development",$r="staging",Wr="production",Kr={[Hr]:"https://staging-api.skypath.io",[Xr]:"https://dev-api.skypath.io",[$r]:"https://staging-api.skypath.io",[Wr]:"https://api.skypath.io"};const Zr="0.4.15",Jr="SDKLogger",tA={SDK:`[SkyPathSDK v${Zr}]:`,NETWORK:"[Network]:"},eA="Invalid listener",nA="Missing authentication parameters",rA="Failed to authenticate with authCallback",AA="Failed to authenticate with API key",iA="Failed to get authentication token";class oA extends Error{constructor({error:t,context:e={}}){t||={message:"Unknown error"},super(t.message),this.name=this.constructor.name,this.context=e;const n=kr.getLogger(Jr);n?.error(this.message,{context:e},e?.error||t)}}class sA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class aA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class uA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class cA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class lA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}const fA={INFO:"/v5/gtg/info",DATA:"/v5/gtg/{resolution}/{hexId}"};class hA{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:fA.INFO})).data}catch(t){throw new aA("Failed to get GTG info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=fA.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r};return(await this.#t({path:A,params:i})).data}catch(t){throw new aA("Failed to get GTG data",{error:t})}}}var pA=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var A,i,o,s,a=!1;A="object"==typeof window,i="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,a=o&&!A&&!i,s=!A&&!a&&!i;var u,c,l,f,h,p="";a?(p=__dirname+"/",u=function(t,e){var n;return(n=rt(t))||(f||(f=require("fs")),h||(h=require("path")),t=h.normalize(t),n=f.readFileSync(t)),e?n:n.toString()},l=function(t){var e=u(t,!0);return e.buffer||(e=new Uint8Array(e)),m(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(u=function(t){var e=rt(t);return e?et(e):read(t)}),l=function(t){var e;return(e=rt(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(m("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(A||i)&&(i?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=rt(t);if(n)return et(n);throw e}},i&&(l=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=rt(t);if(n)return n;throw e}}),c=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 A=rt(t);A?e(A.buffer):n()}},r.onerror=n,r.send(null)});var d=n.print||console.log.bind(console),g=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var y=0;var _=!1;function m(t,e){t||yt("Assertion failed: "+e)}function v(t){var e=n["_"+t];return m(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function E(t,e,n,r,A){var i={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 A=n,i=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>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)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,I,e,n)})(t,e=at(n),n)}return e},array:function(t){var e=at(t.length);return function(t,e){b.set(t,e)}(t,e),e}};var o=v(t),s=[],a=0;if(r)for(var u=0;u<r.length;u++){var c=i[n[u]];c?(0===a&&(a=ct()),s[u]=c(r[u])):s[u]=r[u]}var l=o.apply(null,s);return l=function(t){return"string"===e?L(t):"boolean"===e?Boolean(t):t}(l),0!==a&&ut(a),l}var w,b,I,C,x,N,S,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(t,e){return t?function(t,e,n){for(var r=e+n,A=e;t[A]&&!(A>=r);)++A;if(A-e>16&&t.subarray&&D)return D.decode(t.subarray(e,A));for(var i="";e<A;){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)i+=String.fromCharCode(o);else{var u=o-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i}(I,t,e):""}function T(t,e){return t%e>0&&(t+=e-t%e),t}function M(t){w=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=C=new Int16Array(t),n.HEAP32=x=new Int32Array(t),n.HEAPU8=I=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=N=new Float32Array(t),n.HEAPF64=S=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var O=n.TOTAL_MEMORY||33554432;function R(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()}}O=(w=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,M(w),x[6032]=5267040;var P=[],k=[],B=[],F=[];var G=Math.abs,U=Math.ceil,Q=Math.floor,V=Math.min,z=0,q=null;n.preloadedImages={},n.preloadedAudios={};var Y,j,H=null,X="data:application/octet-stream;base64,";function $(t){return String.prototype.startsWith?t.startsWith(X):0===t.indexOf(X)}H="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//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function W(t){return t}function K(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function Z(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return b.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(b),it(e),M(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r>255&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,r,A,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(u++))<<2|(A=s.indexOf(t.charAt(u++)))>>4,n=(15&A)<<4|(i=s.indexOf(t.charAt(u++)))>>2,r=(3&i)<<6|(o=s.indexOf(t.charAt(u++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==o&&(a+=String.fromCharCode(r))}while(u<t.length);return a};function rt(t){if($(t))return function(t){if("boolean"==typeof a&&a){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),r=new Uint8Array(n.length),A=0;A<n.length;++A)r[A]=n.charCodeAt(A);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(X.length))}var At=function(t,e,n){var r=new t.Int8Array(n),A=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var i=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,E=t.Math.min,w=t.Math.max,b=t.Math.clz32,I=e.b,C=e.c,x=e.d,N=e.e,S=e.f,D=e.g,L=e.h,T=e.i,M=24160;function O(t,e,n,r){return 0|R(t|=0,e|=0,n|=0,r|=0,0)}function R(t,e,n,r,i){var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,a=o,!(0|P(t|=0,e|=0,n|=0,r|=0,i|=0)))return M=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,a)))break;a=0|A[(u=a)>>2],u=0|A[u+4>>2]}else c=0|Be(0|n,0|(s=((0|n)<0)<<31>>31),3,0),u=0|C(),s=0|Me(0|n,0|s,1,0),s=0|Me(0|(s=0|Be(0|c,0|u,0|s,0|C())),0|C(),1,0),u=0|C(),A[a>>2]=s,A[a+4>>2]=u,a=s;if(He(0|r,0,a<<3),0|i){He(0|i,0,a<<2),s=0|k(t,e,n,r,i,a,u,0);break}(s=0|Te(a,4))?(c=0|k(t,e,n,r,s,a,u,0),Le(s),s=c):s=13}else s=2}while(0);return M=o,0|(c=s)}function P(t,e,n,r,i){t|=0,e|=0,n|=0,r|=0,i|=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,A[(d=o=s)>>2]=t,A[d+4>>2]=e,(0|n)<0)return M=s,0|(g=2);if(A[(a=r)>>2]=t,A[a+4>>2]=e,(a=!!(0|i))&&(A[i>>2]=0),0|Bt(t,e))return M=s,0|(g=9);A[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|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,A[i+(h<<2)>>2]=d,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(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|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(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,i,o,s,a){n|=0,r|=0,i|=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|Ge(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),p=0|C(),!(!(0|(_=0|A[(y=d=r+(f<<3)|0)>>2]))&!(0|(y=0|A[y+4>>2]))|(h=(0|_)==(0|t)&(0|y)==(0|e))))do{f=0|Fe(0|(f=0|Me(0|f,0|p,1,0)),0|C(),0|o,0|s),p=0|C(),h=(0|(y=0|A[(_=d=r+(f<<3)|0)>>2]))==(0|t)&(0|(_=0|A[_+4>>2]))==(0|e)}while(!(!(0|y)&!(0|_)|h));if(f=i+(f<<2)|0,h&&(0|A[f>>2])<=(0|a))return M=l,0|(_=0);if(A[(_=d)>>2]=t,A[_+4>>2]=e,A[f>>2]=a,(0|a)>=(0|n))return M=l,0|(_=0);switch(h=a+1|0,A[u>>2]=0,0|(f=0|B(t,e,2,u,c))){case 9:g=9;break;case 0:(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h))||(g=9)}t:do{if(9==(0|g)){switch(A[u>>2]=0,0|(f=0|B(t,e,3,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,1,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,5,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,4,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,6,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,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,i){t|=0,e|=0,i|=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|(i=1);if(f=(0|A[(r|=0)>>2])%6|0,A[r>>2]=f,(0|f)>0){a=0;do{n=0|pt(n),a=a+1|0}while((0|a)<(0|A[r>>2]))}if(f=0|Qe(0|t,0|e,45),C(),(s=127&f)>>>0>121)return 0|(i=5);o=0|Ft(t,e),a=0|Qe(0|t,0|e,52),C(),a&=15;t:do{if(a){for(;;){if(c=0|Qe(0|t,0|e,0|(u=3*(15-a|0)|0)),C(),7==(0|(c&=7))){e=5;break}if(p=!(0|zt(a)),a=a+-1|0,h=0|Ve(7,0,0|u),e&=~C(),t=0|Ve(0|A[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|t&~h,e|=u=0|C(),!(n=0|A[(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|Ve(0|(p=0|A[848+(28*s|0)+(n<<2)>>2]),0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+(n<<2)>>2],127&~p||(p=0|Ve(0|A[848+(28*s|0)+20>>2],0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+20>>2],t=0|Ut(p|t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]))),c=0|Qe(0|t,0|e,45),C(),c&=127;t:do{if(0|U(c)){e:do{if(1==(0|Ft(t,e))){if((0|s)!=(0|c)){if(0|q(c,0|A[7696+(28*s|0)>>2])){t=0|Vt(t,e),u=1,e=0|C();break}x(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ut(t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]),u=0;break e;case 5:t=0|Vt(t,e),e=0|C(),A[r>>2]=5+(0|A[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|Gt(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|Q(c))){if(!!(0|u)|5!=(0|Ft(t,e)))break;A[r>>2]=1+(0|A[r>>2]);break}switch(127&f){case 8:case 118:break t}3!=(0|Ft(t,e))&&(A[r>>2]=1+(0|A[r>>2]))}}else if((0|n)>0){a=0;do{t=0|Ut(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return A[r>>2]=((0|A[r>>2])+n|0)%6|0,A[(p=i)>>2]=t,A[p+4>>2]=e,0|(p=0)}function F(t,e,n,r){n|=0,r|=0;var i,o,s,a=0,u=0;for(s=M,M=M+16|0,i=s,o=s+8|0,a=(a=!(0|Bt(t|=0,e|=0)))?1:2;;){if(A[o>>2]=0,!(0|B(t,e,a,o,i))&((0|A[(u=i)>>2])==(0|n)?(0|A[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 G(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,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,R=0,P=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|A[(t|=0)>>2]))<=0)return M=_,0|(P=0);for(l=t+4|0,f=d+8|0,h=g+8|0,p=u+8|0,m=0,O=0;;){T=(E=0|A[l>>2])+(O<<4)|0,A[d>>2]=A[T>>2],A[d+4>>2]=A[T+4>>2],A[d+8>>2]=A[T+8>>2],A[d+12>>2]=A[T+12>>2],(0|O)==(v+-1|0)?(A[g>>2]=A[E>>2],A[g+4>>2]=A[E+4>>2],A[g+8>>2]=A[E+8>>2],A[g+12>>2]=A[E+12>>2]):(T=E+(O+1<<4)|0,A[g>>2]=A[T>>2],A[g+4>>2]=A[T+4>>2],A[g+8>>2]=A[T+8>>2],A[g+12>>2]=A[T+12>>2]),v=0|W(d,g,r,y);t:do{if(v)E=0,m=v;else if(v=0|A[(E=y)>>2],(0|(E=0|A[E+4>>2]))>0|!(0|E)&v>>>0>0){L=0,T=0;e:for(;;){if(G=+i[d>>3],F=+((D=0|Oe(0|v,0|E,0|L,0|T))>>>0)+4294967296*+(0|C()),k=+(v>>>0)+4294967296*+(0|E),B=+(L>>>0)+4294967296*+(0|T),i[u>>3]=G*F/k+ +i[g>>3]*B/k,i[p>>3]=+i[f>>3]*F/k+ +i[h>>3]*B/k,0|(v=0|qt(u,r,c))){m=v;break}I=0|Ge(0|(S=0|A[(D=c)>>2]),0|(D=0|A[D+4>>2]),0|e,0|n),w=0|C(),E=0|A[(b=v=a+(I<<3)|0)>>2],b=0|A[b+4>>2];n:do{if(!(0|E)&!(0|b))R=v,P=16;else for(x=0,N=0;;){if((0|x)>(0|n)|(0|x)==(0|n)&N>>>0>e>>>0){m=1;break e}if((0|E)==(0|S)&(0|b)==(0|D))break n;if(I=0|Fe(0|(v=0|Me(0|I,0|w,1,0)),0|C(),0|e,0|n),w=0|C(),N=0|Me(0|N,0|x,1,0),x=0|C(),!(0|(E=0|A[(b=v=a+(I<<3)|0)>>2]))&!(0|(b=0|A[b+4>>2]))){R=v,P=16;break}}}while(0);if(16!=(0|P)||(P=0,!(0|S)&!(0|D))||(A[(N=R)>>2]=S,A[N+4>>2]=D,N=s+(A[o>>2]<<3)|0,A[N>>2]=S,A[N+4>>2]=D,N=0|Me(0|A[(N=o)>>2],0|A[N+4>>2],1,0),S=0|C(),A[(D=o)>>2]=N,A[D+4>>2]=S),L=0|Me(0|L,0|T,1,0),T=0|C(),v=0|A[(E=y)>>2],!((0|(E=0|A[E+4>>2]))>(0|T)|(0|E)==(0|T)&v>>>0>L>>>0)){E=1;break t}}E=0}else E=1}while(0);if(O=O+1|0,!E){P=21;break}if((0|O)>=(0|(v=0|A[t>>2]))){m=0,P=21;break}}return 21==(0|P)?(M=_,0|m):0}function U(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|A[7696+(28*t|0)+16>>2])}function Q(t){return 4==(0|(t|=0))|117==(0|t)}function V(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)>>2]}function z(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)+4>>2]}function q(t,e){return e|=0,(0|A[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|A[7696+(28*t|0)+24>>2])==(0|e))}function Y(t,e){return 0|A[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function j(t,e){return e|=0,(0|A[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|A[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|A[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|A[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|A[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|A[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|A[848+(28*t|0)+24>>2])==(0|e)?6:7)}function H(t){return+i[(t|=0)+16>>3]<+i[t+24>>3]|0}function X(t,e){t|=0;var n,r,A=0;return(A=+i[(e|=0)>>3])>=+i[t+8>>3]&&A<=+i[t>>3]?(n=+i[t+16>>3],A=+i[t+24>>3],e=(r=+i[e+8>>3])>=A,t=r<=n&1,n<A?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function $(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,b=0;h=M,M=M+288|0,f=h+264|0,_=h+96|0,g=(d=y=h)+96|0;do{A[d>>2]=0,d=d+4|0}while((0|d)<(0|g));return 0|(e=0|$t(e,y))?(M=h,0|(w=e)):(Ht(y=0|A[(g=y)>>2],g=0|A[g+4>>2],f),Xt(y,g,_),l=+te(f,_+8|0),i[f>>3]=+i[t>>3],i[(g=f+8|0)>>3]=+i[t+16>>3],i[_>>3]=+i[t+8>>3],i[(y=_+8|0)>>3]=+i[t+24>>3],s=+te(f,_),b=+i[g>>3]-+i[y>>3],c=+u(+b),p=+i[f>>3]-+i[_>>3],r=+u(+p),!(0==b|0==p)&&(b=+ze(+c,+r),b=+m(+s*s/+qe(+b/+qe(+c,+r),3)/(l*(2.59807621135*l)*.8)),i[o>>3]=b,v=~~b>>>0,w=+u(b)>=1?b>0?~~+E(+a(b/4294967296),4294967295)>>>0:~~+m((b-+(~~b>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2])?(_=!(0|v)&!(0|w),A[(e=n)>>2]=_?1:v,A[e+4>>2]=_?0:w,e=0):e=1,M=h,0|(w=e))}function W(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{A[h>>2]=0,h=h+4|0}while((0|h)<(0|s));return 0|(n=0|$t(n,p))?(M=f,0|(r=n)):(Ht(h=0|A[(n=p)>>2],n=0|A[n+4>>2],c),Xt(h,n,l),d=+te(c,l+8|0),d=+m(+ +te(t,e)/(2*d)),i[o>>3]=d,n=~~d>>>0,h=+u(d)>=1?d>0?~~+E(+a(d/4294967296),4294967295)>>>0:~~+m((d-+(~~d>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2]?(p=!(0|n)&!(0|h),A[r>>2]=p?1:n,A[r+4>>2]=p?0:h,M=f,0|(r=0)):(M=f,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,A[(t|=0)>>2]=e,A[t+4>>2]=n,A[t+8>>2]=r}function Z(t,e){t|=0;var n,r,o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0;A[(s=(e|=0)+8|0)>>2]=0,r=+i[t>>3],f=+u(+r),o=+i[t+8>>3],f+=.5*(h=+u(+o)/.8660254037844386),f-=+(0|(a=~~f)),h-=+(0|(t=~~h));do{if(f<.5){if(f<.3333333333333333){if(A[e>>2]=a,h<.5*(f+1)){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(t=(1&!(h<(d=1-f)))+t|0,A[e+4>>2]=t,d<=h&h<2*f){a=a+1|0,A[e>>2]=a;break}A[e>>2]=a;break}if(!(f<.6666666666666666)){if(a=a+1|0,A[e>>2]=a,h<.5*f){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(h<1-f){if(A[e+4>>2]=t,2*f-1<h){A[e>>2]=a;break}}else t=t+1|0,A[e+4>>2]=t;a=a+1|0,A[e>>2]=a}while(0);do{if(r<0){if(1&t){a=~~(+(0|a)-(2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))+1)),A[e>>2]=a;break}a=~~(+(0|a)-2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))),A[e>>2]=a;break}}while(0);p=e+4|0,o<0&&(a=a-((1|t<<1)/2|0)|0,A[e>>2]=a,t=0-t|0,A[p>>2]=t),c=t-a|0,(0|a)<0?(l=0-a|0,A[p>>2]=c,A[s>>2]=l,A[e>>2]=0,t=c,a=0):l=0,(0|t)<0&&(a=a-t|0,A[e>>2]=a,l=l-t|0,A[s>>2]=l,A[p>>2]=0,t=0),n=a-l|0,c=t-l|0,(0|l)<0&&(A[e>>2]=n,A[p>>2]=c,A[s>>2]=0,t=c,a=n,l=0),(0|(c=(0|l)<(0|(c=(0|t)<(0|a)?t:a))?l:c))<=0||(A[e>>2]=a-c,A[p>>2]=t-c,A[s>>2]=l-c)}function J(t){var e,n=0,r=0,i=0,o=0,s=0;n=0|A[(t|=0)>>2],r=0|A[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,A[e>>2]=r,A[(s=t+8|0)>>2]=(0|A[s>>2])-n,A[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,A[t>>2]=n,o=(0|A[(s=t+8|0)>>2])-r|0,A[s>>2]=o,A[e>>2]=0,r=0):(s=o=t+8|0,o=0|A[o>>2]),(0|o)<0&&(n=n-o|0,A[t>>2]=n,r=r-o|0,A[e>>2]=r,A[s>>2]=0,o=0),(0|(i=(0|o)<(0|(i=(0|r)<(0|n)?r:n))?o:i))<=0||(A[t>>2]=n-i,A[e>>2]=r-i,A[s>>2]=o-i)}function tt(t,e){e|=0;var n,r;r=0|A[(t|=0)+8>>2],n=+((0|A[t+4>>2])-r|0),i[e>>3]=+((0|A[t>>2])-r|0)-.5*n,i[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[e>>2])+(0|A[t>>2]),A[n+4>>2]=(0|A[e+4>>2])+(0|A[t+4>>2]),A[n+8>>2]=(0|A[e+8>>2])+(0|A[t+8>>2])}function nt(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[t>>2])-(0|A[e>>2]),A[n+4>>2]=(0|A[t+4>>2])-(0|A[e+4>>2]),A[n+8>>2]=(0|A[t+8>>2])-(0|A[e+8>>2])}function rt(t,e){e|=0;var n,r=0;r=0|v(0|A[(t|=0)>>2],e),A[t>>2]=r,n=0|v(0|A[(r=t+4|0)>>2],e),A[r>>2]=n,e=0|v(0|A[(t=t+8|0)>>2],e),A[t>>2]=e}function At(t){var e,n,r=0,i=0,o=0,s=0,a=0;a=(0|(n=0|A[(t|=0)>>2]))<0,t=(t=(i=(0|(s=((e=(0|(o=(0|A[t+4>>2])-(a?n:0)|0))<0)?0-o|0:0)+((0|A[t+8>>2])-(a?n:0))|0))<0)?0:s)-((o=(0|(i=(0|t)<(0|(i=(0|(r=(e?0:o)-(i?s:0)|0))<(0|(s=(a?0:n)-(e?o:0)-(i?s:0)|0))?r:s))?t:i))>0)?i:0)|0,r=r-(o?i:0)|0;t:do{switch(s-(o?i: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 it(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(a=1)}else{if((-2147483648-s|0)>(0|s))return 0|(a=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(a=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1)}else if((-2147483648-o|0)>(0|o))return 0|(a=1);if(i=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(a=1)}else if((-2147483648^n)<(0|o))return 0|(a=1);if(r){if(!((2147483647-s|0)<(0|i))){r=i;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|i))){r=i;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);i=0|Se(+(n-o|0)/7),A[t>>2]=i,o=0|Se(+(r+s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,355,22455)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function ot(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1)}else if((-2147483648-s|0)>(0|s))return 0|(a=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(a=1)}else{if((-2147483648-o|0)>(0|o))return 0|(a=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(a=1)}if(i=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(a=1)}else if((-2147483648-n|0)>(0|o))return 0|(a=1);if((0|o)>-1){if((-2147483648|i)<(0|s)){r=i;break}return 0|(n=1)}if(!((-2147483648^i)<(0|s))){r=i;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);i=0|Se(+(n+o|0)/7),A[t>>2]=i,o=0|Se(+(r-s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,404,22469)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function st(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+((3*(r=(0|A[t>>2])-i|0)|0)-(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((i<<1)+r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function at(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+(((r=(0|A[t>>2])-i|0)<<1)+(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((3*i|0)-r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function ut(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(3*i|0)|0,A[t>>2]=a,o=s+(3*o|0)|0,A[n>>2]=o,i=(3*s|0)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ct(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(3*(i=0|A[(n=t+4|0)>>2])|0)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(3*a|0)|0,A[t>>2]=a,A[n>>2]=s,i=(3*o|0)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function lt(t,e){t|=0;var n,r,i,o=0,s=0,a=0;((e|=0)+-1|0)>>>0>=6||(a=(0|A[15440+(12*e|0)>>2])+(0|A[t>>2])|0,A[t>>2]=a,i=t+4|0,s=(0|A[15440+(12*e|0)+4>>2])+(0|A[i>>2])|0,A[i>>2]=s,r=t+8|0,e=(0|A[15440+(12*e|0)+8>>2])+(0|A[r>>2])|0,A[r>>2]=e,o=s-a|0,(0|a)<0?(e=e-a|0,A[i>>2]=o,A[r>>2]=e,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,e=e-o|0,A[r>>2]=e,A[i>>2]=0,o=0),n=s-e|0,a=o-e|0,(0|e)<0?(A[t>>2]=n,A[i>>2]=a,A[r>>2]=0,s=n,e=0):a=o,(0|(o=(0|e)<(0|(o=(0|a)<(0|s)?a:s))?e:o))<=0||(A[t>>2]=s-o,A[i>>2]=a-o,A[r>>2]=e-o))}function ft(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(i=0|A[(n=t+4|0)>>2])+a|0,a=(o=0|A[(r=t+8|0)>>2])+a|0,A[t>>2]=a,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ht(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],s=0|A[(n=t+4|0)>>2],o=0|A[(r=t+8|0)>>2],a=s+i|0,A[t>>2]=a,s=o+s|0,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function pt(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 dt(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 gt(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(i<<1)|0,A[t>>2]=a,o=s+(o<<1)|0,A[n>>2]=o,i=(s<<1)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function yt(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=((i=0|A[(n=t+4|0)>>2])<<1)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(a<<1)|0,A[t>>2]=a,A[n>>2]=s,i=(o<<1)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function _t(t,e){e|=0;var n,r,i,o=0,s=0,a=0;return i=(0|(r=(0|A[(t|=0)>>2])-(0|A[e>>2])|0))<0,n=(0|(s=(0|A[t+4>>2])-(0|A[e+4>>2])-(i?r:0)|0))<0,e=(e=(t=(0|(a=(i?0-r|0:0)+(0|A[t+8>>2])-(0|A[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=(i?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 mt(t,e){e|=0;var n;n=0|A[(t|=0)+8>>2],A[e>>2]=(0|A[t>>2])-n,A[e+4>>2]=(0|A[t+4>>2])-n}function vt(t,e){e|=0;var n,r,i,o=0,s=0,a=0;s=0|A[(t|=0)>>2],A[e>>2]=s,a=0|A[t+4>>2],A[(r=e+4|0)>>2]=a,A[(i=e+8|0)>>2]=0,t=(o=(0|a)<(0|s))?s:a,o=o?a:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=a-s|0,(0|s)<0?(o=0-s|0,A[r>>2]=t,A[i>>2]=o,A[e>>2]=0,s=0):(t=a,o=0),(0|t)<0&&(s=s-t|0,A[e>>2]=s,o=o-t|0,A[i>>2]=o,A[r>>2]=0,t=0),n=s-o|0,a=t-o|0,(0|o)<0?(A[e>>2]=n,A[r>>2]=a,A[i>>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||(A[e>>2]=a-s,A[r>>2]=t-s,A[i>>2]=o-s),0|(e=0)}function Et(t){var e,n,r,i;n=(i=0|A[(e=(t|=0)+8|0)>>2])-(0|A[t>>2])|0,A[t>>2]=n,t=(0|A[(r=t+4|0)>>2])-i|0,A[r>>2]=t,A[e>>2]=0-(t+n)}function wt(t){var e,n,r=0,i=0,o=0,s=0,a=0;r=0-(i=0|A[(t|=0)>>2])|0,A[t>>2]=r,A[(e=t+8|0)>>2]=0,s=(o=0|A[(n=t+4|0)>>2])+i|0,(0|i)>0?(A[n>>2]=s,A[e>>2]=i,A[t>>2]=0,r=0,o=s):i=0,(0|o)<0?(a=r-o|0,A[t>>2]=a,i=i-o|0,A[e>>2]=i,A[n>>2]=0,s=a-i|0,r=0-i|0,(0|i)<0?(A[t>>2]=s,A[n>>2]=r,A[e>>2]=0,o=r,i=0):(o=0,s=a)):s=r,(0|(r=(0|i)<(0|(r=(0|o)<(0|s)?o:s))?i:r))<=0||(A[t>>2]=s-r,A[n>>2]=o-r,A[e>>2]=i-r)}function bt(t,e,n){n|=0;var r,i,o=0,s=0;return i=M,M=M+16|0,r=i,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|Qe(0|(t|=0),0|e,56),C(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,i=0,o=0;if(o=M,M=M+16|0,i=o,r=0|Bt(t,e),(n+-1|0)>>>0>5)return M=o,0|(i=-1);if(r=!!(0|r),1==(0|n)&r)return M=o,0|(i=-1);do{if(!(0|me(t,e,i))){if(r){r=(5+(0|A[21936+(n<<2)>>2])-(0|A[i>>2])|0)%5|0;break}r=(6+(0|A[21968+(n<<2)>>2])-(0|A[i>>2])|0)%6|0;break}r=-1}while(0);return i=r,M=o,0|i}(t,s,7&o),-1==(0|o)?(A[n>>2]=0,M=i,0|(s=6)):(0|jt(t,s,r)&&x(23313,22484,282,22499),e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,s)?Nt(r,e,o,2,n):Tt(r,e,o,2,n),M=i,0|(s=0))):(M=i,0|(s=6))}function It(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,A=0;n=+i[t>>3],r=+f(+n),n=+h(+n),i[e+16>>3]=n,n=+i[t+8>>3],A=r*+f(+n),i[e>>3]=A,n=r*+h(+n),i[e+8>>3]=n}(t,o),A[e>>2]=0,i[n>>3]=5,r=+_e(16400,o),r<+i[n>>3]&&(A[e>>2]=0,i[n>>3]=r);r=+_e(16424,o),r<+i[n>>3]&&(A[e>>2]=1,i[n>>3]=r);r=+_e(16448,o),r<+i[n>>3]&&(A[e>>2]=2,i[n>>3]=r);r=+_e(16472,o),r<+i[n>>3]&&(A[e>>2]=3,i[n>>3]=r);r=+_e(16496,o),r<+i[n>>3]&&(A[e>>2]=4,i[n>>3]=r);r=+_e(16520,o),r<+i[n>>3]&&(A[e>>2]=5,i[n>>3]=r);r=+_e(16544,o),r<+i[n>>3]&&(A[e>>2]=6,i[n>>3]=r);r=+_e(16568,o),r<+i[n>>3]&&(A[e>>2]=7,i[n>>3]=r);r=+_e(16592,o),r<+i[n>>3]&&(A[e>>2]=8,i[n>>3]=r);r=+_e(16616,o),r<+i[n>>3]&&(A[e>>2]=9,i[n>>3]=r);r=+_e(16640,o),r<+i[n>>3]&&(A[e>>2]=10,i[n>>3]=r);r=+_e(16664,o),r<+i[n>>3]&&(A[e>>2]=11,i[n>>3]=r);r=+_e(16688,o),r<+i[n>>3]&&(A[e>>2]=12,i[n>>3]=r);r=+_e(16712,o),r<+i[n>>3]&&(A[e>>2]=13,i[n>>3]=r);r=+_e(16736,o),r<+i[n>>3]&&(A[e>>2]=14,i[n>>3]=r);r=+_e(16760,o),r<+i[n>>3]&&(A[e>>2]=15,i[n>>3]=r);r=+_e(16784,o),r<+i[n>>3]&&(A[e>>2]=16,i[n>>3]=r);r=+_e(16808,o),r<+i[n>>3]&&(A[e>>2]=17,i[n>>3]=r);r=+_e(16832,o),r<+i[n>>3]&&(A[e>>2]=18,i[n>>3]=r);if(r=+_e(16856,o),!(r<+i[n>>3]))return void(M=s);A[e>>2]=19,i[n>>3]=r,M=s}(t|=0,n|=0,c=o),(a=+d(+(1-.5*+i[c>>3])))<1e-16)return A[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=0,A[r+12>>2]=0,void(M=o);if(c=0|A[n>>2],s=+Zt((s=+i[15920+(24*c|0)>>3])-+Zt(+function(t,e){t|=0,e|=0;var n=0,r=0,A=0,o=0,s=0;return o=+i[e>>3],r=+f(+o),A=+i[e+8>>3]-+i[t+8>>3],s=r*+h(+A),n=+i[t>>3],+ +_(+s,+(+h(+o)*+f(+n)-+f(+A)*(r*+h(+n))))}(15600+(c<<4)|0,t))),u=0|zt(e)?+Zt(s+-.3334731722518321):s,s=+p(+a)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}a=+f(+u)*s,i[r>>3]=a,u=+h(+u)*s,i[r+8>>3]=u,M=o}function Ct(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,a=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+i[t>>3],e=+i[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,A[o>>2]=A[e>>2],A[o+4>>2]=A[e+4>>2],A[o+8>>2]=A[e+8>>2],void(A[o+12>>2]=A[e+12>>2]);if(a=+_(+ +i[t+8>>3],+ +i[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=!(0|zt(n)),s=+y(.381966011250105*(n?s:s/2.6457513110645907))):(s=+y(.381966011250105*s),0|zt(n)&&(a=+Zt(a+.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 A[r>>2]=A[t>>2],A[r+4>>2]=A[t+4>>2],A[r+8>>2]=A[t+8>>2],void(A[r+12>>2]=A[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=+i[t>>3],o){e-=n,i[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)),i[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return i[r>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[r>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(c=+f(+e),s=n*+h(+s)/c,n=+i[t>>3],e=(a-+h(+e)*+h(+n))/+f(+n)/c,a=s>1?1:s,e=e>1?1:e,(e=+i[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(i[r+8>>3]=e)}e=+i[t>>3]+n,i[r>>3]=e,o=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return i[o>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[o>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(e=+i[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);i[r+8>>3]=e}(15600+(e<<4)|0,+Zt(+i[15920+(24*e|0)>>3]-a),s,o)}function xt(t,e,n){e|=0,n|=0;var r,i;r=M,M=M+16|0,tt((t|=0)+4|0,i=r),Ct(i,0|A[t>>2],e,0,n),M=r}function Nt(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,E,w,b,I,C,N,S,D,L=0,T=0,O=0,R=0,P=0,k=0;if(D=M,M=M+272|0,R=D+240|0,C=D,N=D+224|0,S=D+208|0,y=D+176|0,_=D+160|0,m=D+192|0,v=D+144|0,E=D+128|0,w=D+112|0,b=D+96|0,I=D+80|0,A[(L=D+256|0)>>2]=e,A[R>>2]=A[t>>2],A[R+4>>2]=A[t+4>>2],A[R+8>>2]=A[t+8>>2],A[R+12>>2]=A[t+12>>2],St(R,L,C),A[o>>2]=0,(0|(R=r+n+(5==(0|r)&1)|0))<=(0|n))M=D;else{a=N+4|0,u=y+4|0,c=n+5|0,l=16880+((s=0|A[L>>2])<<2)|0,f=16960+(s<<2)|0,h=E+8|0,p=w+8|0,d=b+8|0,g=S+4|0,O=n;t:for(;;){T=C+((0|O)%5<<4)|0,A[S>>2]=A[T>>2],A[S+4>>2]=A[T+4>>2],A[S+8>>2]=A[T+8>>2],A[S+12>>2]=A[T+12>>2];do{}while(2==(0|Dt(S,s,0,1)));if((0|O)>(0|n)&!!(0|zt(e))){if(A[y>>2]=A[S>>2],A[y+4>>2]=A[S+4>>2],A[y+8>>2]=A[S+8>>2],A[y+12>>2]=A[S+12>>2],tt(a,_),r=0|A[y>>2],L=0|A[17040+(80*r|0)+(A[N>>2]<<2)>>2],A[y>>2]=A[18640+(80*r|0)+(20*L|0)>>2],(0|(T=0|A[18640+(80*r|0)+(20*L|0)+16>>2]))>0){t=0;do{ft(u),t=t+1|0}while((0|t)<(0|T))}switch(T=18640+(80*r|0)+(20*L|0)+4|0,A[m>>2]=A[T>>2],A[m+4>>2]=A[T+4>>2],A[m+8>>2]=A[T+8>>2],rt(m,3*(0|A[l>>2])|0),et(u,m,u),J(u),tt(u,v),P=+(0|A[f>>2]),i[E>>3]=3*P,i[h>>3]=0,k=-1.5*P,i[w>>3]=k,i[p>>3]=2.598076211353316*P,i[b>>3]=k,i[d>>3]=-2.598076211353316*P,0|A[17040+(80*(0|A[y>>2])|0)+(A[S>>2]<<2)>>2]){case 1:t=w,r=E;break;case 3:t=b,r=w;break;case 2:t=E,r=b;break;default:t=12;break t}ge(_,v,r,t,I),Ct(I,0|A[y>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])}if((0|O)<(0|c)&&(tt(g,y),Ct(y,0|A[S>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),A[N>>2]=A[S>>2],A[N+4>>2]=A[S+4>>2],A[N+8>>2]=A[S+8>>2],A[N+12>>2]=A[S+12>>2],(0|(O=O+1|0))>=(0|R)){t=3;break}}3!=(0|t)?12==(0|t)&&x(22522,22569,571,22579):M=D}}function St(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+128|0,o=r,a=20240,u=(s=i=r+64|0)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20304,u=(s=o)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|zt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|zt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,n=n+68|0),J(n),M=r}function Dt(t,e,n,r){n|=0,r|=0;var i,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|A[16960+((e|=0)<<2)>>2],p=(a=!!(0|r))?3*p|0:p,l=0|A[d>>2],i=0|A[(s=t+8|0)>>2],a){if((0|(l=i+l+(r=0|A[(f=t+12|0)>>2])|0))==(0|p))return M=c,0|(d=1);h=f}else l=i+l+(r=0|A[(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|A[t>>2],(0|i)>0){f=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(u,p,0,0),nt(d,u,o),ht(o),et(o,u,d),f=r,r=t):(f=r,r=t)}else f=18640+(80*(0|A[t>>2])|0)+20|0,r=t}while(0);if(A[r>>2]=A[f>>2],(0|A[(l=f+16|0)>>2])>0){r=0;do{ft(d),r=r+1|0}while((0|r)<(0|A[l>>2]))}return t=f+4|0,A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],e=0|A[16880+(e<<2)>>2],rt(u,a?3*e|0:e),et(d,u,d),J(d),r=a&&((0|A[s>>2])+(0|A[d>>2])+(0|A[h>>2])|0)==(0|p)?1:2,M=c,0|(d=r)}function Lt(t,e){t|=0,e|=0;var n=0;do{n=0|Dt(t,e,0,1)}while(2==(0|n));return 0|n}function Tt(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,E,w,b,I,C=0,N=0,S=0,D=0,L=0;if(I=M,M=M+240|0,v=I+208|0,E=I,w=I+192|0,b=I+176|0,d=I+160|0,g=I+144|0,y=I+128|0,_=I+112|0,m=I+96|0,A[(C=I+224|0)>>2]=e,A[v>>2]=A[t>>2],A[v+4>>2]=A[t+4>>2],A[v+8>>2]=A[t+8>>2],A[v+12>>2]=A[t+12>>2],Mt(v,C,E),A[o>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))M=I;else{a=n+6|0,u=16960+((s=0|A[C>>2])<<2)|0,c=g+8|0,l=y+8|0,f=_+8|0,h=w+4|0,N=0,S=n,r=-1;t:for(;;){if(t=E+((C=(0|S)%6|0)<<4)|0,A[w>>2]=A[t>>2],A[w+4>>2]=A[t+4>>2],A[w+8>>2]=A[t+8>>2],A[w+12>>2]=A[t+12>>2],t=N,N=0|Dt(w,s,0,1),(0|S)>(0|n)&!!(0|zt(e))&&(1!=(0|t)&&(0|A[w>>2])!=(0|r))){switch(tt(E+((C+5|0)%6<<4)+4|0,b),tt(E+(C<<4)+4|0,d),D=+(0|A[u>>2]),i[g>>3]=3*D,i[c>>3]=0,L=-1.5*D,i[y>>3]=L,i[l>>3]=2.598076211353316*D,i[_>>3]=L,i[f>>3]=-2.598076211353316*D,C=0|A[v>>2],0|A[17040+(80*C|0)+(((0|r)==(0|C)?A[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}ge(b,d,r,t,m),0|ye(b,m)||0|ye(d,m)||(Ct(m,0|A[v>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2]))}if((0|S)<(0|a)&&(tt(h,b),Ct(b,0|A[w>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),(0|(S=S+1|0))>=(0|p)){t=3;break}r=0|A[w>>2]}3!=(0|t)?8==(0|t)&&x(22606,22569,736,22651):M=I}}function Mt(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+160|0,o=r,a=20368,u=(s=i=r+80|0)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20448,u=(s=o)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|zt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|zt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,e=n+68|0),J(e),A[n+80>>2]=A[t>>2],et(o,i+60|0,n=n+84|0),J(n),M=r}function Ot(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),45),C(),127&e}function Rt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|Qe(0|(t|=0),0|e,45),C(),(o&=127)>>>0>121)return 0|(e=0);n=0|Qe(0|t,0|e,52),C(),n&=15;do{if(0|n){for(A=1,r=0;;){if(i=0|Qe(0|t,0|e,3*(15-A|0)|0),C(),!!(0|(i&=7))&(1^r)){if(1==(0|i)&!!(0|U(o))){s=0,r=13;break}r=1}if(7==(0|i)){s=0,r=13;break}if(!(A>>>0<n>>>0)){r=9;break}A=A+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|Qe(0|t,0|e,3*(14-n|0)|0),C(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Pt(t,e,n,r){n|=0,r|=0;var i=0,o=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return A[r>>2]=t,A[r+4>>2]=e,0|(r=0);if(i=0|Ve(0|n,0,52),i|=t,t=C()|-15728641&e,(0|o)>(0|n))do{e=0|Ve(7,0,3*(14-n|0)|0),n=n+1|0,i|=e,t=C()|t}while((0|n)<(0|o));return A[r>>2]=i,A[r+4>>2]=t,0|(r=0)}function kt(t,e,n,r){n|=0,r|=0;var i=0,o=0,s=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);i=n-o|0,n=0|Qe(0|t,0|e,45),C();t:do{if(0|U(127&n)){e:do{if(0|o){for(n=1;!((s=0|Ve(7,0,3*(15-n|0)|0))&t)&!(C()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C();break t}}while(0);n=0|Me(0|(n=0|Be(0|(n=0|le(7,0,i,((0|i)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),n=0|Me(0|(n=0|ke(0|n,0|C(),6,0)),0|C(),1,0),i=0|C()}else n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C()}while(0);return A[(s=r)>>2]=n,A[s+4>>2]=i,0|(s=0)}function Bt(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&A)))return 0|(A=0);A=0|Qe(0|t,0|e,52),C(),A&=15;t:do{if(A)for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7))break t;if(!(r>>>0<A>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(A=1&!(0|n))}function Ft(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(A&=15))return 0|(A=0);for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7)){r=5;break}if(!(r>>>0<A>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Gt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|Ve(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|Ve(0|pt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),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|Qe(0|t,0|e,0|(o=3*(15-n|0)|0)),C(),i=0|Ve(7,0,0|o),e&=~C(),t=t&~i|(o=0|Ve(0|pt(7&A),0,0|o)),e|=C(),!(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 I(0|e),0|t}function Ut(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;o=0|Qe(0|t,0|e,0|(i=3*(15-n|0)|0)),C(),A=0|Ve(7,0,0|i),e&=~C(),t=(i=0|Ve(0|pt(7&o),0,0|i))|t&~A,e=C()|e,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Qt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|Ve(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|Ve(0|dt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),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|Ve(7,0,0|(A=3*(15-n|0)|0)),o=e&~C(),e=0|Qe(0|t,0|e,0|A),C(),t=t&~i|(e=0|Ve(0|dt(7&e),0,0|A)),e=o|C(),!(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 I(0|e),0|t}function Vt(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;i=0|Ve(7,0,0|(o=3*(15-n|0)|0)),A=e&~C(),e=0|Qe(0|t,0|e,0|o),C(),t=(e=0|Ve(0|dt(7&e),0,0|o))|t&~i,e=C()|A,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function zt(t){return(0|(t|=0))%2|0}function qt(t,e,n){n|=0;var r,i=0;return r=M,M=M+16|0,i=r,(e|=0)>>>0>15?(M=r,0|(i=4)):2146435072&~A[(t|=0)+4>>2]&&2146435072&~A[t+8+4>>2]?(function(t,e,n){var r,A;r=M,M=M+16|0,It(t|=0,e|=0,n|=0,A=r),Z(A,n+4|0),M=r}(t,e,i),e=0|function(t,e){t|=0;var n,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0;if(n=M,M=M+64|0,u=n+40|0,i=n+24|0,o=n+12|0,s=n,Ve(0|(e|=0),0,52),r=134225919|C(),!e)return(0|A[t+4>>2])>2||(0|A[t+8>>2])>2||(0|A[t+12>>2])>2?(u=0,I(0|(a=0)),M=n,0|u):(Ve(0|V(t),0,45),a=C()|r,u=-1,I(0|a),M=n,0|u);if(A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],A[u+12>>2]=A[t+12>>2],a=u+4|0,(0|e)>0)for(t=-1;A[i>>2]=A[a>>2],A[i+4>>2]=A[a+4>>2],A[i+8>>2]=A[a+8>>2],1&e?(st(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ut(o)):(at(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ct(o)),nt(i,o,s),J(s),c=0|Ve(7,0,0|(l=3*(15-e|0)|0)),r&=~C(),t=(l=0|Ve(0|At(s),0,0|l))|t&~c,r=C()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|A[a>>2])<=2&&(0|A[u+8>>2])<=2&&(0|A[u+12>>2])<=2){if(e=0|Ve(0|(i=0|V(u)),0,45),e|=t,t=C()|-1040385&r,s=0|z(u),!(0|U(i))){if((0|s)<=0)break;for(o=0;;){if(i=0|Qe(0|e,0|t,52),C(),i&=15)for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|Ve(7,0,0|l),t&=~C(),e=e&~c|(l=0|Ve(0|pt(7&u),0,0|l)),t|=C(),r>>>0<i>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|Qe(0|e,0|t,52),C(),o&=15;e:do{if(o){r=1;n:for(;;){switch(l=0|Qe(0|e,0|t,3*(15-r|0)|0),C(),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|q(i,0|A[u>>2]))for(r=1;c=0|Ve(7,0,0|(u=3*(15-r|0)|0)),l=t&~C(),t=0|Qe(0|e,0|t,0|u),C(),e=e&~c|(t=0|Ve(0|dt(7&t),0,0|u)),t=l|C(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|Ve(7,0,0|l),t&=~C(),e=e&~c|(l=0|Ve(0|pt(7&u),0,0|l)),t|=C(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|Gt(e,t),t=0|C(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return l=e,I(0|(c=t)),M=n,0|l}(i,e),i=0|C(),A[n>>2]=e,A[n+4>>2]=i,!(0|e)&!(0|i)&&x(23313,22674,786,22697),M=r,0|(i=0)):(M=r,0|(i=3))}function Yt(t,e,n){var r,i=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|Qe(0|(t|=0),0|(e|=0),52),C(),o&=15,s=0|Qe(0|t,0|e,45),C(),i=!(0|o),0|U(127&s)){if(i)return 0|(s=1);i=1}else{if(i)return 0|(s=0);i=0|A[r>>2]||0|A[n+8>>2]?1:1&!!(0|A[n+12>>2])}for(n=1;1&n?ut(r):ct(r),s=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),lt(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|i}function jt(t,e,n){n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+16|0,r=i,l=0|Qe(0|(t|=0),0|(e|=0),45),C(),(l&=127)>>>0>121)return A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,A[n+12>>2]=0,M=i,0|(l=5);t:do{if(0|U(l)&&(a=0|Qe(0|t,0|e,52),C(),0|(a&=15))){o=1;e:for(;;){switch(c=0|Qe(0|t,0|e,3*(15-o|0)|0),C(),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|Ve(7,0,0|(e=3*(15-s|0)|0)),c=o&~C(),o=0|Qe(0|t,0|o,0|e),C(),t=t&~u|(o=0|Ve(0|dt(7&o),0,0|e)),o=c|C(),s>>>0<a>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*l|0)|0,A[n>>2]=A[c>>2],A[n+4>>2]=A[c+4>>2],A[n+8>>2]=A[c+8>>2],A[n+12>>2]=A[c+12>>2],!(0|Yt(t,o,n)))return M=i,0|(l=0);if(u=n+4|0,A[r>>2]=A[u>>2],A[r+4>>2]=A[u+4>>2],A[r+8>>2]=A[u+8>>2],a=0|Qe(0|t,0|o,52),C(),c=15&a,1&a?(ct(u),a=c+1|0):a=c,0|U(l)){t:do{if(c)for(e=1;;){if(s=0|Qe(0|t,0|o,3*(15-e|0)|0),C(),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|Dt(n,a,o,0)){if(0|U(l))do{}while(0|Dt(n,a,0,0));(0|a)!=(0|c)&&at(u)}else(0|a)!=(0|c)&&(A[u>>2]=A[r>>2],A[u+4>>2]=A[r+4>>2],A[u+8>>2]=A[r+8>>2]);return M=i,0|(l=0)}function Ht(t,e,n){n|=0;var r,A,i=0;return A=M,M=M+16|0,0|(i=0|jt(t|=0,e|=0,r=A))?(M=A,0|i):(i=0|Qe(0|t,0|e,52),C(),xt(r,15&i,n),M=A,0|(i=0))}function Xt(t,e,n){n|=0;var r,A=0,i=0,o=0;if(r=M,M=M+16|0,0|(A=0|jt(t|=0,e|=0,o=r)))return M=r,0|(o=A);A=0|Qe(0|t,0|e,45),C(),A=!(0|U(127&A)),i=0|Qe(0|t,0|e,52),C(),i&=15;t:do{if(!A){if(0|i)for(A=1;;){if(!(!((0|Ve(7,0,3*(15-A|0)|0))&t)&!(C()&e)))break t;if(!(A>>>0<i>>>0))break;A=A+1|0}return Nt(o,i,0,5,n),M=r,0|0}}while(0);return Tt(o,i,0,6,n),M=r,0|0}function $t(t,e){e|=0;var n=0,r=0,i=0,o=0,s=0,a=0,u=0;if((t|=0)>>>0>15)return 0|(a=4);if(Ve(0|t,0,52),a=134225919|C(),!t){n=0,r=0;do{0|U(r)&&(Ve(0|r,0,45),s=a|C(),A[(t=e+(n<<3)|0)>>2]=-1,A[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|U(s)){for(Ve(0|s,0,45),r=1,i=-1,o=a|C();i&=~(u=0|Ve(7,0,3*(15-r|0)|0)),o&=~C(),(0|r)!=(0|t);)r=r+1|0;A[(u=e+(n<<3)|0)>>2]=i,A[u+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Wt(t,e,n,r){t|=0,r|=0;var i=0,o=0;i=0|Qe(0|(e|=0),0|(n|=0),52),C(),!(0|e)&!(0|n)|(0|r)>15|(0|(i&=15))>(0|r)?(r=-1,i=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,I(0|(n=e)),0|r):(n=0|Ve(-1,-1,3+(3*(r-n|0)|0)|0),r=0|Ve(0|~n,0|~C(),3*(15-r|0)|0),n=~C()&e,r=~r&t,I(0|n),0|r)}(e,n,i+1|0,r),n=-15728641&C(),e=0|Ve(0|r,0,52),r=(o=!(0|Bt(e|=o,n|=C())))?-1:r),A[(o=t)>>2]=e,A[o+4>>2]=n,A[t+8>>2]=i,A[t+12>>2]=r}function Kt(t){var e,n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0;if(!(!(0|(n=0|A[(r=t|=0)>>2]))&!(0|(r=0|A[r+4>>2]))||(i=0|Qe(0|n,0|r,52),C(),n=0|Me(0|(u=0|Ve(1,0,3*(15^(i&=15))|0)),0|C(),0|n,0|r),r=0|C(),A[(u=t)>>2]=n,A[u+4>>2]=r,(0|i)<(0|(a=0|A[(u=t+8|0)>>2]))))){for(e=t+12|0,s=i;;){if((0|s)==(0|a)){i=5;break}if(c=(0|s)==(0|A[e>>2]),i=0|Qe(0|n,0|r,0|(o=3*(15-s|0)|0)),C(),c&1==(0|(i&=7))&!0){i=7;break}if(!(7==(0|i)&!0)){i=10;break}if(n=0|Me(0|n,0|r,0|(c=0|Ve(1,0,0|o)),0|C()),r=0|C(),A[(c=t)>>2]=n,A[c+4>>2]=r,!((0|s)>(0|a))){i=10;break}s=s+-1|0}if(5==(0|i))return A[(c=t)>>2]=0,A[c+4>>2]=0,A[u>>2]=-1,void(A[e>>2]=-1);if(7==(0|i))return a=0|Me(0|n,0|r,0|(a=0|Ve(1,0,0|o)),0|C()),u=0|C(),A[(c=t)>>2]=a,A[c+4>>2]=u,void(A[e>>2]=s+-1)}}function Zt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Jt(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<17453292519943298e-27?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Be(0|(n=0|le(7,0,t,((0|t)<0)<<31>>31)),0|C(),120,0),t=0|C(),A[e>>2]=2|n,A[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,A,o,s,a=0,u=0,l=0,d=0,g=0,m=0;return m=+i[(e|=0)>>3],o=+i[t>>3],g=+h(.5*(m-o)),l=+i[e+8>>3],A=+i[t+8>>3],d=+h(.5*(l-A)),r=+f(+o),s=+f(+m),d=2*+_(+ +c(+(d=g*g+d*(s*r*d))),+ +c(+(1-d))),g=+i[n>>3],m=+h(.5*(g-m)),a=+i[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*(A-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 re(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|Ht(t|=0,e|=0,r=s+168|0)))return M=s,0|(n=u);if(0|Xt(t,e,o)&&x(23313,22742,386,22751),(0|(e=0|A[o>>2]))>0){if(a=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{a+=+ne(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 i[n>>3]=a,M=s,0|(n=0)}function Ae(t){t|=0;var e,n,r=0;return(e=0|Te(1,12))||x(22832,22787,49,22845),0|(r=0|A[(n=t+4|0)>>2])?(A[(r=r+8|0)>>2]=e,A[n>>2]=e,0|e):(0|A[t>>2]&&x(22862,22787,61,22885),A[(r=t)>>2]=e,A[n>>2]=e,0|e)}function ie(t,e){t|=0,e|=0;var n,r;return(r=0|De(24))||x(22899,22787,78,22913),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[r+16>>2]=0,0|(n=0|A[(e=t+4|0)>>2])?(A[n+16>>2]=r,A[e>>2]=r,0|r):(0|A[t>>2]&&x(22928,22787,82,22913),A[t>>2]=r,A[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,i=0;if(t|=0)for(r=1;;){if(0|(e=0|A[t>>2]))do{if(0|(n=0|A[e>>2]))do{i=n,n=0|A[n+16>>2],Le(i)}while(0|n);i=e,e=0|A[e+8>>2],Le(i)}while(0|e);if(e=t,t=0|A[t+8>>2],r||Le(e),!t)break;r=0}}function se(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,E=0,w=0,b=0,I=0,C=0,N=0,S=0,D=0,L=0,T=0,M=0,O=0,R=0,P=0,k=0;if(0|A[(a=(t|=0)+8|0)>>2])return 0|(k=1);if(!(s=0|A[t>>2]))return 0|(k=0);r=s,o=0;do{o=o+1|0,r=0|A[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(k=0);(n=0|De(o<<2))||x(22948,22787,317,22967),(e=0|De(o<<5))||x(22989,22787,321,22967),A[t>>2]=0,A[(S=t+4|0)>>2]=0,A[a>>2]=0,o=0,R=0,N=0,g=0;t:for(;;){if(d=0|A[s>>2]){c=0,l=d;do{if(h=+i[l+8>>3],r=l,l=0|A[l+16>>2],f=+i[(a=(p=!(0|l))?d:l)+8>>3],+u(+(h-f))>3.141592653589793){k=14;break}c+=(f-h)*(+i[r>>3]+ +i[a>>3])}while(!p);if(14==(0|k)){k=0,c=0,r=d;do{C=+i[r+8>>3],M=0|A[(O=r+16|0)>>2],I=+i[(M=0|M?M:d)+8>>3],c+=(+i[r>>3]+ +i[M>>3])*((I<0?I+6.283185307179586:I)-(C<0?C+6.283185307179586:C)),r=0|A[(0|r?O:s)>>2]}while(0|r)}c>0?(A[n+(R<<2)>>2]=s,R=R+1|0,a=N,r=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!o){if(g){a=S,l=g+8|0,r=s,o=t;break}if(0|A[t>>2]){k=27;break t}a=S,l=t,r=s,o=t;break}if(0|A[(r=o+8|0)>>2]){k=21;break t}if(!(o=0|Te(1,12))){k=23;break t}A[r>>2]=o,a=o+4|0,l=o,r=g}while(0);if(A[l>>2]=s,A[a>>2]=s,l=e+(N<<5)|0,p=0|A[s>>2]){for(i[(d=e+(N<<5)+8|0)>>3]=17976931348623157e292,i[(g=e+(N<<5)+24|0)>>3]=17976931348623157e292,i[l>>3]=-17976931348623157e292,i[(y=e+(N<<5)+16|0)>>3]=-17976931348623157e292,w=17976931348623157e292,b=-17976931348623157e292,a=0,_=p,h=17976931348623157e292,v=17976931348623157e292,E=-17976931348623157e292,f=-17976931348623157e292;c=+i[_>>3],C=+i[_+8>>3],_=0|A[_+16>>2],I=+i[((m=!(0|_))?p:_)+8>>3],c<h&&(i[d>>3]=c,h=c),C<v&&(i[g>>3]=C,v=C),c>E?i[l>>3]=c:c=E,C>f&&(i[y>>3]=C,f=C),w=C>0&C<w?C:w,b=C<0&C>b?C:b,a|=+u(+(C-I))>3.141592653589793,!m;)E=c;a&&(i[y>>3]=b,i[g>>3]=w)}else A[l>>2]=0,A[l+4>>2]=0,A[l+8>>2]=0,A[l+12>>2]=0,A[l+16>>2]=0,A[l+20>>2]=0,A[l+24>>2]=0,A[l+28>>2]=0;a=N+1|0}if(s=0|A[(O=s+8|0)>>2],A[O>>2]=0,!s){k=45;break}N=a,g=r}if(21==(0|k))x(22765,22787,35,22799);else if(23==(0|k))x(22819,22787,37,22799);else if(27==(0|k))x(22862,22787,61,22885);else if(45==(0|k)){t:do{if((0|R)>0){for(O=!(0|a),T=a<<2,M=!(0|t),L=0,r=0;;){if(D=0|A[n+(L<<2)>>2],O)k=73;else{if(!(N=0|De(T))){k=50;break}if(!(S=0|De(T))){k=52;break}e:do{if(M)o=0;else{for(a=0,o=0,l=t;s=e+(a<<5)|0,0|ae(0|A[l>>2],s,0|A[D>>2])?(A[N+(o<<2)>>2]=l,A[S+(o<<2)>>2]=s,m=o+1|0):m=o,l=0|A[l+8>>2];)a=a+1|0,o=m;if((0|m)>0)if(s=0|A[N>>2],1==(0|m))o=s;else for(y=0,_=-1,o=s,g=s;;){for(p=0|A[g>>2],s=0,l=0;d=(0|(a=0|A[A[N+(l<<2)>>2]>>2]))==(0|p)?s:s+(1&ae(a,0|A[S+(l<<2)>>2],0|A[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|A[N+(s<<2)>>2]}else o=0}}while(0);if(Le(N),Le(S),o){if(s=0|A[(a=o+4|0)>>2])o=s+8|0;else if(0|A[o>>2]){k=70;break}A[o>>2]=D,A[a>>2]=D}else k=73}if(73==(0|k)){if(k=0,0|(r=0|A[D>>2]))do{S=r,r=0|A[r+16>>2],Le(S)}while(0|r);Le(D),r=1}if((0|(L=L+1|0))>=(0|R)){P=r;break t}}50==(0|k)?x(23004,22787,249,23023):52==(0|k)?x(23042,22787,252,23023):70==(0|k)&&x(22862,22787,61,22885)}else P=0}while(0);return Le(n),Le(e),0|(k=P)}return 0}function ae(t,e,n){t|=0;var r=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;if(!(0|X(e|=0,n|=0)))return 0|(t=0);if(e=0|H(e),r=+i[n>>3],o=e&(o=+i[n+8>>3])<0?o+6.283185307179586:o,!(t=0|A[t>>2]))return 0|(t=0);if(e){e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[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|A[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|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[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|A[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|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ue(t,e,n,i,o){n|=0,i|=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|Qe(0|(t|=0),0|(e|=0),52),C(),l&=15,y=0|Qe(0|n,0|i,52),C(),(0|l)!=(15&y))return M=c,0|(v=12);if(d=0|Qe(0|t,0|e,45),C(),d&=127,g=0|Qe(0|n,0|i,45),C(),d>>>0>121|(g&=127)>>>0>121)return M=c,0|(v=5);if(y=(0|d)!=(0|g)){if(7==(0|(h=0|j(d,g))))return M=c,0|(v=1);7==(0|(p=0|j(g,d)))?x(23066,23090,161,23100):(_=h,f=p)}else _=0,f=0;s=0|U(d),a=0|U(g),A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0;do{if(_){if(h=(0|(g=0|A[4272+(28*d|0)+(_<<2)>>2]))>0,a)if(h){d=0,p=n,h=i;do{p=0|Qt(p,h),h=0|C(),1==(0|(f=0|dt(f)))&&(f=0|dt(1)),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;else if(h){d=0,p=n,h=i;do{p=0|Vt(p,h),h=0|C(),f=0|dt(f),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;if(Yt(d,p,v),y||x(23115,23090,191,23100),(h=!!(0|s))&(f=!!(0|a))&&x(23142,23090,192,23100),h){if(7==(0|(f=0|Ft(t,e)))){l=5;break}if(0|r[21872+(7*f|0)+_|0]){l=1;break}d=p=0|A[21040+(28*f|0)+(_<<2)>>2]}else if(f){if(7==(0|(f=0|Ft(d,p)))){l=5;break}if(0|r[21872+(7*f|0)+g|0]){l=1;break}d=0,p=0|A[21040+(28*g|0)+(f<<2)>>2]}else d=0,p=0;if((d|p)<0)l=5;else{if((0|p)>0){h=v+4|0,f=0;do{ht(h),f=f+1|0}while((0|f)!=(0|p))}if(A[u>>2]=0,A[u+4>>2]=0,A[u+8>>2]=0,lt(u,_),0|l)for(;0|zt(l)?ut(u):ct(u),(0|l)>1;)l=l+-1|0;if((0|d)>0){l=0;do{ht(u),l=l+1|0}while((0|l)!=(0|d))}et(m=v+4|0,u,m),J(m),m=51}}else if(Yt(n,i,v),!!(0|s)&!!(0|a))if((0|g)!=(0|d)&&x(23173,23090,261,23100),7==(0|(f=0|Ft(t,e)))|7==(0|(l=0|Ft(n,i))))l=5;else if(0|r[21872+(7*f|0)+l|0])l=1;else if((0|(f=0|A[21040+(28*f|0)+(l<<2)>>2]))>0){h=v+4|0,l=0;do{ht(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,A[o>>2]=A[l>>2],A[o+4>>2]=A[l+4>>2],A[o+8>>2]=A[l+8>>2],l=0),M=c,0|(v=l)}function ce(t,e,n,r){n|=0,r|=0;var i,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,i=s+36|0,c=s+24|0,l=s+12|0,f=s,a=0|Qe(0|(t|=0),0|(e|=0),52),C(),a&=15,p=0|Qe(0|t,0|e,45),C(),(p&=127)>>>0>121)return M=s,0|(r=5);if(o=0|U(p),Ve(0|a,0,52),y=134225919|C(),A[(u=r)>>2]=-1,A[u+4>>2]=y,!a)return 7==(0|(a=0|At(n)))||127==(0|(a=0|Y(p,a)))?(M=s,0|(y=1)):(d=0|Ve(0|a,0,45),g=0|C(),g=-1040385&A[(p=r)+4>>2]|g,A[(y=r)>>2]=A[p>>2]|d,A[y+4>>2]=g,M=s,0|(y=0));for(A[i>>2]=A[n>>2],A[i+4>>2]=A[n+4>>2],A[i+8>>2]=A[n+8>>2],n=a;;){if(u=n,n=n+-1|0,A[c>>2]=A[i>>2],A[c+4>>2]=A[i+4>>2],A[c+8>>2]=A[i+8>>2],0|zt(u)){if(0|(a=0|it(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ut(l)}else{if(0|(a=0|ot(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ct(l)}if(nt(c,l,f),J(f),m=0|A[(a=r)>>2],a=0|A[a+4>>2],_=0|Ve(7,0,0|(v=3*(15-u|0)|0)),a&=~C(),v=0|Ve(0|At(f),0,0|v),a=C()|a,A[(y=r)>>2]=v|m&~_,A[y+4>>2]=a,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|A[i>>2])<=1&&(0|A[i+4>>2])<=1&&(0|A[i+8>>2])<=1){f=127==(0|(a=0|Y(p,n=0|At(i))))?0:0|U(a);e:do{if(n){if(o){if(7==(0|(a=0|Ft(t,e)))){a=5;break t}if((0|(u=0|A[21248+(28*a|0)+(n<<2)>>2]))>0){a=n,n=0;do{a=0|pt(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|Y(p,a)))&&x(23200,23090,411,23230),0|U(n)?x(23245,23090,412,23230):(g=n,d=u,h=a)}else g=a,d=0,h=n;if((0|(l=0|A[4272+(28*p|0)+(h<<2)>>2]))<=-1&&x(23276,23090,419,23230),!f){if((0|d)<0){a=5;break t}if(0|d){a=0,n=0|A[(u=r)>>2],u=0|A[u+4>>2];do{n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[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|A[(u=r)>>2],u=0|A[u+4>>2];;)if(n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=u,(0|(a=a+1|0))==(0|l)){a=g,n=58;break e}}if(7==(0|(c=0|j(g,p)))&&x(23066,23090,428,23230),n=0|A[(a=r)>>2],a=0|A[a+4>>2],(0|l)>0){u=0;do{n=0|Ut(n,a),a=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=a,u=u+1|0}while((0|u)!=(0|l))}if(7==(0|(a=0|Ft(n,a)))&&x(23313,23090,440,23230),n=0|Q(g),(0|(n=0|A[(n?21664:21456)+(28*c|0)+(a<<2)>>2]))<0&&x(23313,23090,454,23230),n){a=0,u=0|A[(c=r)>>2],c=0|A[c+4>>2];do{u=0|Gt(u,c),c=0|C(),A[(v=r)>>2]=u,A[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|Ft(t,e)))|7==(0|(u=0|Ft(0|A[(u=r)>>2],0|A[u+4>>2])))){a=5;break t}if((0|(u=0|A[21248+(28*n|0)+(u<<2)>>2]))<0){a=5;break t}if(u){n=0,c=0|A[(l=r)>>2],l=0|A[l+4>>2];do{c=0|Ut(c,l),l=0|C(),A[(v=r)>>2]=c,A[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|Ft(0|A[(v=r)>>2],0|A[v+4>>2]))){a=9;break}_=0|A[(v=r)>>2],v=-1040385&A[v+4>>2],m=0|Ve(0|a,0,45),v|=C(),A[(a=r)>>2]=_|m,A[a+4>>2]=v,a=0}else a=1}while(0);return M=s,0|(v=a)}function le(t,e,n,r){t|=0,e|=0;var A=0,i=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return i=1,I(0|(A=0)),0|i;i=t,A=e,t=1,e=0;do{t=0|Be(0|((o=!0&!(1&n))?1:i),0|(o?0:A),0|t,0|e),e=0|C(),n=0|Ue(0|n,0|r,1),r=0|C(),i=0|Be(0|i,0|A,0|i,0|A),A=0|C()}while(!(!(0|n)&!(0|r)));return I(0|e),0|t}function fe(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|X(e|=0,n|=0)))return 0|(p=0);if(e=0|H(e),o=+i[n>>3],s=e&(s=+i[n+8>>3])<0?s+6.283185307179586:s,(0|(p=0|A[t>>2]))<=0)return 0|(p=0);if(r=0|A[t+4>>2],e){e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[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=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[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 he(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,E=0;if(!(r=0|A[(t|=0)>>2]))return A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,void(A[e+28>>2]=0);if(i[(o=e+8|0)>>3]=17976931348623157e292,i[(s=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(a=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|A[t+4>>2],y=17976931348623157e292,_=-17976931348623157e292,m=0,t=-1,h=17976931348623157e292,p=17976931348623157e292,g=-17976931348623157e292,l=-17976931348623157e292,v=0;c=+i[n+(v<<4)>>3],d=+i[n+(v<<4)+8>>3],f=+i[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<h&&(i[o>>3]=c,h=c),d<p&&(i[s>>3]=d,p=d),c>g?i[e>>3]=c:c=g,d>l&&(i[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);)E=v,g=c,v=t,t=E;m&&(i[a>>3]=_,i[s>>3]=y)}}function pe(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,E=0,w=0,b=0,I=0,C=0,x=0;if(_=0|A[(t|=0)>>2]){if(i[(m=e+8|0)>>3]=17976931348623157e292,i[(v=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(E=e+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(s=0|A[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,o=0,r=-1,f=17976931348623157e292,h=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292,w=0;a=+i[s+(w<<4)>>3],p=+i[s+(w<<4)+8>>3],l=+i[s+(((0|(C=r+2|0))==(0|_)?0:C)<<4)+8>>3],a<f&&(i[m>>3]=a,f=a),p<h&&(i[v>>3]=p,h=p),a>d?i[e>>3]=a:a=d,p>c&&(i[E>>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|_);)C=w,d=a,w=r,r=C;o&&(i[E>>3]=y,i[v>>3]=g)}}else A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,A[e+28>>2]=0;if(!((0|(r=0|A[(C=t+8|0)>>2]))<=0)){n=t+12|0,I=0;do{if(s=0|A[n>>2],o=I,v=e+((I=I+1|0)<<5)|0,E=0|A[s+(o<<3)>>2]){if(i[(w=e+(I<<5)+8|0)>>3]=17976931348623157e292,i[(t=e+(I<<5)+24|0)>>3]=17976931348623157e292,i[v>>3]=-17976931348623157e292,i[(b=e+(I<<5)+16|0)>>3]=-17976931348623157e292,(0|E)>0){for(_=0|A[s+(o<<3)+4>>2],g=17976931348623157e292,y=-17976931348623157e292,s=0,o=-1,m=0,f=17976931348623157e292,h=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;a=+i[_+(m<<4)>>3],d=+i[_+(m<<4)+8>>3],l=+i[_+(((0|(o=o+2|0))==(0|E)?0:o)<<4)+8>>3],a<f&&(i[w>>3]=a,f=a),d<h&&(i[t>>3]=d,h=d),a>p?i[v>>3]=a:a=p,d>c&&(i[b>>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|E);)x=m,m=o,p=a,o=x;s&&(i[b>>3]=y,i[t>>3]=g)}}else A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0,A[v+16>>2]=0,A[v+20>>2]=0,A[v+24>>2]=0,A[v+28>>2]=0,r=0|A[C>>2]}while((0|I)<(0|r))}}function de(t,e,n){var r=0,i=0,o=0;if(!(0|fe(t|=0,e|=0,n|=0)))return 0|(i=0);if((0|A[(i=t+8|0)>>2])<=0)return 0|(i=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|fe((0|A[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|A[i>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function ge(t,e,n,r,A){e|=0,n|=0,r|=0,A|=0;var o,s,a,u,c,l,f,h=0;u=+i[(t|=0)>>3],a=+i[e>>3]-u,s=+i[t+8>>3],o=+i[e+8>>3]-s,l=+i[n>>3],h=((h=+i[r>>3]-l)*(s-(f=+i[n+8>>3]))-(u-l)*(c=+i[r+8>>3]-f))/(a*c-o*h),i[A>>3]=u+a*h,i[A+8>>3]=s+o*h}function ye(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function _e(t,e){e|=0;var n,r,A;return+((A=+i[(t|=0)>>3]-+i[e>>3])*A+(r=+i[t+8>>3]-+i[e+8>>3])*r+(n=+i[t+16>>3]-+i[e+16>>3])*n)}function me(t,e,n){n|=0;var r,i,o,s,a=0,u=0,c=0;if(s=M,M=M+32|0,c=s,0|(a=0|jt(t|=0,e|=0,i=s+16|0)))return M=s,0|(n=a);r=0|Ot(t,e),o=0|Ft(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,A[(e|=0)>>2]=A[t>>2],A[e+4>>2]=A[t+4>>2],A[e+8>>2]=A[t+8>>2],A[e+12>>2]=A[t+12>>2]}(r,c),a=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|A[11120+(216*e|0)>>2])!=(0|t))if((0|A[11120+(216*e|0)+8>>2])!=(0|t))if((0|A[11120+(216*e|0)+16>>2])!=(0|t))if((0|A[11120+(216*e|0)+24>>2])!=(0|t))if((0|A[11120+(216*e|0)+32>>2])!=(0|t))if((0|A[11120+(216*e|0)+40>>2])!=(0|t))if((0|A[11120+(216*e|0)+48>>2])!=(0|t))if((0|A[11120+(216*e|0)+56>>2])!=(0|t))if((0|A[11120+(216*e|0)+64>>2])!=(0|t))if((0|A[11120+(216*e|0)+72>>2])!=(0|t))if((0|A[11120+(216*e|0)+80>>2])!=(0|t))if((0|A[11120+(216*e|0)+88>>2])!=(0|t))if((0|A[11120+(216*e|0)+96>>2])!=(0|t))if((0|A[11120+(216*e|0)+104>>2])!=(0|t))if((0|A[11120+(216*e|0)+112>>2])!=(0|t))if((0|A[11120+(216*e|0)+120>>2])!=(0|t))if((0|A[11120+(216*e|0)+128>>2])!=(0|t)){if((0|A[11120+(216*e|0)+136>>2])!=(0|t)){if((0|A[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|A[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|A[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|A[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|A[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|A[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|A[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|A[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|A[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|A[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|A[i>>2]);t:do{if(0|U(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:a=1;break t}if(u=0|A[22e3+(24*t|0)+8>>2],e=0|A[22e3+(24*t|0)+16>>2],(0|(t=0|A[i>>2]))!=(0|A[c>>2])&&(c=0|Q(r))|(0|(t=0|A[i>>2]))==(0|e)&&(a=(a+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){a=(a+5|0)%6|0,u=22;break}5==(0|o)&(0|t)==(0|u)?(a=(a+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(A[n>>2]=a,a=0),M=s,0|(n=a)}function ve(t,e,n,r){n|=0,r|=0;var i,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,i=u,p=(p=!(0|Bt(t|=0,e|=0)))?6:5,g=0|Qe(0|t,0|e,52),C(),p>>>0<=n>>>0)return M=u,0|(r=2);!(y=!(0|(g&=15)))&&!((_=0|Ve(7,0,3*(15^g)|0))&t)&!(C()&e)?c=n:l=4;t:do{if(4==(0|l)){if((0|((c=!!(0|Bt(t,e)))?4:5))<(0|n))return M=u,0|(r=1);if(0|me(t,e,v))return M=u,0|(r=1);if(l=(0|A[v>>2])+n|0,7==(0|(_=0|A[(c=c?22288+((0|l)%5<<2)|0:22320+((0|l)%6<<2)|0)>>2])))return M=u,0|(r=1);A[a>>2]=0,c=0|B(t,e,_,a,s);do{if(!c){if(d=0|A[(h=s)>>2],l=(f=(h=0|A[h+4>>2])>>>0<e>>>0|(0|h)==(0|e)&d>>>0<t>>>0)?d:t,f=f?h:e,!y&&!(d&(y=0|Ve(7,0,3*(15^g)|0)))&!(h&C()))c=n;else{if(h=(n+-1+p|0)%(0|p)|0,c=0|Bt(t,e),(0|h)<0&&x(23313,23315,245,23324),(0|((p=!!(0|c))?4:5))<(0|h)&&x(23313,23315,245,23324),0|me(t,e,v)&&x(23313,23315,245,23324),c=(0|A[v>>2])+h|0,7==(0|(h=0|A[(c=p?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&x(23313,23315,245,23324),A[o>>2]=0,0|(c=0|B(t,e,h,o,i)))break;p=0|A[(d=i)>>2],d=0|A[d+4>>2];do{if(d>>>0<f>>>0|(0|d)==(0|f)&p>>>0<l>>>0){if(l=0|Bt(p,d)?0|F(p,d,t,e):0|A[22384+(((0|A[o>>2])+(0|A[22352+(h<<2)>>2])|0)%6<<2)>>2],c=0|Bt(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|me(p,d,v))){if(c){c=(5+(0|A[21936+(l<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(l<<2)>>2])-(0|A[v>>2])|0)%6|0;break}c=-1}while(0);l=p,f=d}else c=n}while(0);d=0|A[(h=s)>>2],h=0|A[h+4>>2]}if((0|l)==(0|d)&(0|f)==(0|h)){if(t=(p=!!(0|Bt(d,h)))?0|F(d,h,t,e):0|A[22384+(((0|A[a>>2])+(0|A[22352+(_<<2)>>2])|0)%6<<2)>>2],c=0|Bt(d,h),(t+-1|0)>>>0<=5&&!(1==(0|t)&(m=!!(0|c))))do{if(!(0|me(d,h,v))){if(m){c=(5+(0|A[21936+(t<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(t<<2)>>2])-(0|A[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|Ve(0|c,0,56),v=C()|-2130706433&e|536870912,A[r>>2]=m|t,A[r+4>>2]=v,M=u,0|(r=0)}function Ee(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Te(e,4),A[t>>2]=r,r||x(23337,23360,40,23374)):A[t>>2]=0,A[t+4>>2]=e,A[t+8>>2]=0,A[t+12>>2]=n}function we(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|A[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(a=0|A[t>>2],c=0|A[a+(o<<2)>>2])break;o=o+1|0}o=a+(~~(+u(+ +l(10,+ +(15-(0|A[n>>2])|0))*(+i[c>>3]+ +i[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|A[o>>2];e:do{if(0|s){if(a=c+32|0,(0|s)==(0|c))A[o>>2]=A[a>>2];else{if(!(o=0|A[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|A[(s=o+32|0)>>2]))break e;A[s>>2]=A[a>>2]}Le(c),A[r>>2]=(0|A[r>>2])-1}}while(0)}Le(0|A[t>>2])}function be(t){var e,n=0,r=0;for(e=0|A[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|A[(0|A[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function Ie(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,n=(0|A[t>>2])+(n<<2)|0,!(r=0|A[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|A[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|A[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){A[r+32>>2]=A[s>>2];break}if(10==(0|o))return 0|n}else A[n>>2]=A[s>>2]}while(0);return Le(e),A[(s=t+8|0)>>2]=(0|A[s>>2])-1,0|(s=0)}function Ce(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,a=0;(r=0|De(40))||x(23390,23360,98,23403),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[(s=r+16|0)>>2]=A[n>>2],A[s+4>>2]=A[n+4>>2],A[s+8>>2]=A[n+8>>2],A[s+12>>2]=A[n+12>>2],A[r+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|A[t+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,s=(0|A[t>>2])+(s<<2)|0,o=0|A[s>>2];do{if(o){for(;!(0|Jt(o,e)&&0|Jt(o+16|0,n));)if(s=0|A[o+32>>2],!(0|A[(o=0|s?s:o)+32>>2])){a=10;break}if(10==(0|a)){A[o+32>>2]=r;break}return Le(r),0|(a=o)}A[s>>2]=r}while(0);return A[(a=t+8|0)>>2]=1+(0|A[a>>2]),0|(a=r)}function xe(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(o=0|A[(0|A[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|Jt(t,e)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|Jt(t,e)&&0|Jt(t+16|0,n)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Ne(t,e){e|=0;var n=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(t=0|A[(0|A[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Jt(t,e)){e=5;break}if(!(t=0|A[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Se(t){return 0|+function(t){return+ +Xe(+(t=+t))}(t=+t)}function De(t){t|=0;var e,n=0,r=0,i=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,E=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|A[5857])>>>t))return i=0|A[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|A[(o=i+8|0)>>2]))==(0|t)?A[5857]=h&~(1<<n):(A[s+12>>2]=t,A[r>>2]=s),w=n<<3,A[i+4>>2]=3|w,A[(w=i+w+4|0)>>2]=1|A[w>>2],M=e,0|(w=o);if(l>>>0>(f=0|A[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|A[(t=(n=23468+((i=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(i=(n>>>=t)>>>1&1))+(n>>>i)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|A[(u=s+8|0)>>2]))==(0|n)?(t=h&~(1<<i),A[5857]=t):(A[r+12>>2]=n,A[t>>2]=r,t=h),a=(w=i<<3)-l|0,A[s+4>>2]=3|l,A[(o=s+l|0)+4>>2]=1|a,A[s+w>>2]=a,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=a,A[5862]=o,M=e,0|(w=u);if(s=0|A[5858]){for(r=(s&0-s)-1|0,r=c=0|A[23732+(((i=(r>>>=o=r>>>12&16)>>>5&8)|o|(a=(r>>>=i)>>>2&4)|(u=(r>>>=a)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&A[c+4>>2])-l|0;(t=0|A[r+16>>2])||(t=0|A[r+20>>2]);)r=t,u=(o=(a=(-8&A[t+4>>2])-l|0)>>>0<c>>>0)?t:u,c=o?a:c;if((a=u+l|0)>>>0>u>>>0){o=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){r=0;break}for(;;)if(r=0|A[(i=n+20|0)>>2])n=r,t=i;else{if(!(r=0|A[(i=n+16|0)>>2]))break;n=r,t=i}A[t>>2]=0,r=n}else r=0|A[u+8>>2],A[r+12>>2]=n,A[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|A[u+28>>2],(0|u)==(0|A[(t=23732+(n<<2)|0)>>2])){if(A[t>>2]=r,!r){A[5858]=s&~(1<<n);break}}else if(A[((0|A[(w=o+16|0)>>2])==(0|u)?w:o+20)>>2]=r,!r)break;A[r+24>>2]=o,0|(n=0|A[u+16>>2])&&(A[r+16>>2]=n,A[n+24>>2]=r),0|(n=0|A[u+20>>2])&&(A[r+20>>2]=n,A[n+24>>2]=r)}}while(0);return c>>>0<16?(w=c+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2]):(A[u+4>>2]=3|l,A[a+4>>2]=1|c,A[a+c>>2]=c,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,(n=1<<n)&h?n=0|A[(t=r+8|0)>>2]:(A[5857]=n|h,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=c,A[5862]=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),i=0|A[5858]){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|A[23732+(c<<2)>>2];t:do{if(r)for(t=0,u=l<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((a=(-8&A[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|A[r+20>>2]))|(0|y)==(0|(r=0|A[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)&i)){h=l;break}h=(t&0-t)-1|0,t=0,r=0|A[23732+(((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&A[s+4>>2])-l|0)>>>0<o>>>0)?h:o,t=r?s:t,(r=0|A[s+16>>2])||(r=0|A[s+20>>2]),!r){u=t,a=o;break}s=r}if(0|u&&a>>>0<((0|A[5859])-l|0)>>>0&&(f=u+l|0)>>>0>u>>>0){s=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){n=0;break}for(;;)if(r=0|A[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|A[(o=n+16|0)>>2]))break;n=r,t=o}A[t>>2]=0}else w=0|A[u+8>>2],A[w+12>>2]=n,A[n+8>>2]=w}while(0);do{if(s){if(t=0|A[u+28>>2],(0|u)==(0|A[(r=23732+(t<<2)|0)>>2])){if(A[r>>2]=n,!n){i&=~(1<<t),A[5858]=i;break}}else if(A[((0|A[(w=s+16|0)>>2])==(0|u)?w:s+20)>>2]=n,!n)break;A[n+24>>2]=s,0|(t=0|A[u+16>>2])&&(A[n+16>>2]=t,A[t+24>>2]=n),(t=0|A[u+20>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);t:do{if(a>>>0<16)w=a+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2];else{if(A[u+4>>2]=3|l,A[f+4>>2]=1|a,A[f+a>>2]=a,n=a>>>3,a>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=f,A[n+12>>2]=f,A[f+8>>2]=n,A[f+12>>2]=r;break}if(n=23732+((r=(n=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(r=((w<<=v)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,A[f+28>>2]=r,A[(t=f+16|0)+4>>2]=0,A[t>>2]=0,!(i&(t=1<<r))){A[5858]=i|t,A[n>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break}n=0|A[n>>2];e:do{if((-8&A[n+4>>2])!=(0|a)){for(i=a<<(31==(0|r)?0:25-(r>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|a)){n=t;break e}i<<=1,n=t}A[r>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=f,A[E>>2]=f,A[f+8>>2]=w,A[f+12>>2]=n,A[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|A[5859])>>>0>=h>>>0)return n=r-h|0,t=0|A[5862],n>>>0>15?(w=t+h|0,A[5862]=w,A[5859]=n,A[w+4>>2]=1|n,A[t+r>>2]=n,A[t+4>>2]=3|h):(A[5859]=0,A[5862]=0,A[t+4>>2]=3|r,A[(w=t+r+4|0)>>2]=1|A[w>>2]),M=e,0|(w=t+8|0);if((a=0|A[5860])>>>0>h>>>0)return v=a-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0);if(0|A[5975]?t=0|A[5977]:(A[5977]=4096,A[5976]=4096,A[5978]=-1,A[5979]=-1,A[5980]=0,A[5968]=0,A[5975]=-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|A[5967])&&(p=(f=0|A[5965])+l|0)>>>0<=f>>>0|p>>>0>t>>>0)return M=e,0|(w=0);t:do{if(4&A[5968])n=0,y=143;else{r=0|A[5863];e:do{if(r){for(i=23876;!((p=0|A[i>>2])>>>0<=r>>>0&&(p+(0|A[i+4>>2])|0)>>>0>r>>>0);){if(!(t=0|A[i+8>>2])){y=128;break e}i=t}if((n=s-a&o)>>>0<2147483647)if((0|(t=0|$e(0|n)))==((0|A[i>>2])+(0|A[i+4>>2])|0)){if(-1!=(0|t)){a=n,s=t,y=145;break t}}else i=t,y=136;else n=0}else y=128}while(0);do{if(128==(0|y))if(-1!=(0|(r=0|$e(0)))&&(n=r,g=(n=((g=(d=0|A[5976])+-1|0)&n?(g+n&0-d)-n|0:0)+l|0)+(d=0|A[5965])|0,n>>>0>h>>>0&n>>>0<2147483647)){if(0|(p=0|A[5967])&&g>>>0<=d>>>0|g>>>0>p>>>0){n=0;break}if((0|(t=0|$e(0|n)))==(0|r)){a=n,s=r,y=145;break t}i=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|i))){if(-1==(0|i)){n=0;break}a=n,s=i,y=145;break t}if((t=c-n+(t=0|A[5977])&0-t)>>>0>=2147483647){a=n,s=i,y=145;break t}if(-1==(0|$e(0|t))){$e(0|r),n=0;break}a=t+n|0,s=i,y=145;break t}}while(0);A[5968]=4|A[5968],y=143}}while(0);if(143==(0|y)&&l>>>0<2147483647&&!(-1==(0|(v=0|$e(0|l)))|1^(m=(_=(g=0|$e(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|A[5965])+a|0,A[5965]=n,n>>>0>(0|A[5966])>>>0&&(A[5966]=n),c=0|A[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|A[n>>2])+(r=0|A[n+4>>2])|0)){y=154;break}if(!(i=0|A[n+8>>2]))break;n=i}if(!(154!=(0|y)||(E=n+4|0,8&A[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){A[E>>2]=r+a,E=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(w=(0|A[5860])+a|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[c+w+4>>2]=40,A[5864]=A[5979];break}for(s>>>0<(0|A[5861])>>>0&&(A[5861]=s),r=s+a|0,n=23876;;){if((0|A[n>>2])==(0|r)){y=162;break}if(!(t=0|A[n+8>>2]))break;n=t}if(162==(0|y)&&!(8&A[n+12>>2])){A[n>>2]=s,A[(f=n+4|0)>>2]=(0|A[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,A[f+4>>2]=3|h;e:do{if((0|c)==(0|n))w=(0|A[5860])+u|0,A[5860]=w,A[5863]=l,A[l+4>>2]=1|w;else{if((0|A[5862])==(0|n)){w=(0|A[5859])+u|0,A[5859]=w,A[5862]=l,A[l+4>>2]=1|w,A[l+w>>2]=w;break}if(1==(3&(t=0|A[n+4>>2]))){a=-8&t,i=t>>>3;n:do{if(t>>>0<256){if(t=0|A[n+8>>2],(0|(r=0|A[n+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<i);break}A[t+12>>2]=r,A[r+8>>2]=t;break}s=0|A[n+24>>2],t=0|A[n+12>>2];do{if((0|t)==(0|n)){if(t=0|A[(i=(r=n+16|0)+4|0)>>2])r=i;else if(!(t=0|A[r>>2])){t=0;break}for(;;)if(i=0|A[(o=t+20|0)>>2])t=i,r=o;else{if(!(i=0|A[(o=t+16|0)>>2]))break;t=i,r=o}A[r>>2]=0}else w=0|A[n+8>>2],A[w+12>>2]=t,A[t+8>>2]=w}while(0);if(!s)break;i=23732+((r=0|A[n+28>>2])<<2)|0;do{if((0|A[i>>2])==(0|n)){if(A[i>>2]=t,0|t)break;A[5858]=A[5858]&~(1<<r);break n}if(A[((0|A[(w=s+16|0)>>2])==(0|n)?w:s+20)>>2]=t,!t)break n}while(0);if(A[t+24>>2]=s,0|(i=0|A[(r=n+16|0)>>2])&&(A[t+16>>2]=i,A[i+24>>2]=t),!(r=0|A[r+4>>2]))break;A[t+20>>2]=r,A[r+24>>2]=t}while(0);n=n+a|0,o=a+u|0}else o=u;if(A[(n=n+4|0)>>2]=-2&A[n>>2],A[l+4>>2]=1|o,A[l+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=l,A[n+12>>2]=l,A[l+8>>2]=n,A[l+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){i=31;break}i=o>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1}else i=0}while(0);if(n=23732+(i<<2)|0,A[l+28>>2]=i,A[(t=l+16|0)+4>>2]=0,A[t>>2]=0,!((t=0|A[5858])&(r=1<<i))){A[5858]=t|r,A[n>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break}n=0|A[n>>2];n:do{if((-8&A[n+4>>2])!=(0|o)){for(i=o<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|o)){n=t;break n}i<<=1,n=t}A[r>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break e}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=l,A[E>>2]=l,A[l+8>>2]=w,A[l+12>>2]=n,A[l+24>>2]=0}}while(0);return M=e,0|(w=f+8|0)}for(n=23876;!((t=0|A[n>>2])>>>0<=c>>>0&&(w=t+(0|A[n+4>>2])|0)>>>0>c>>>0);)n=0|A[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,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(r=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+r+4>>2]=40,A[5864]=A[5979],A[(r=t+4|0)>>2]=27,A[n>>2]=A[5969],A[n+4>>2]=A[5970],A[n+8>>2]=A[5971],A[n+12>>2]=A[5972],A[5969]=s,A[5970]=a,A[5972]=0,A[5971]=n,n=t+24|0;do{E=n,A[(n=n+4|0)>>2]=7}while((E+8|0)>>>0<w>>>0);if((0|t)!=(0|c)){if(s=t-c|0,A[r>>2]=-2&A[r>>2],A[c+4>>2]=1|s,A[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=c,A[n+12>>2]=c,A[c+8>>2]=n,A[c+12>>2]=r;break}if(r=23732+((i=(n=s>>>8)?s>>>0>16777215?31:s>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,A[c+28>>2]=i,A[c+20>>2]=0,A[o>>2]=0,!((n=0|A[5858])&(t=1<<i))){A[5858]=n|t,A[r>>2]=c,A[c+24>>2]=r,A[c+12>>2]=c,A[c+8>>2]=c;break}n=0|A[r>>2];e:do{if((-8&A[n+4>>2])!=(0|s)){for(i=s<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|s)){n=t;break e}i<<=1,n=t}A[r>>2]=c,A[c+24>>2]=n,A[c+12>>2]=c,A[c+8>>2]=c;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=c,A[E>>2]=c,A[c+8>>2]=w,A[c+12>>2]=n,A[c+24>>2]=0}}else!(0|(w=0|A[5861]))|s>>>0<w>>>0&&(A[5861]=s),A[5969]=s,A[5970]=a,A[5972]=0,A[5866]=A[5975],A[5865]=-1,A[5870]=23468,A[5869]=23468,A[5872]=23476,A[5871]=23476,A[5874]=23484,A[5873]=23484,A[5876]=23492,A[5875]=23492,A[5878]=23500,A[5877]=23500,A[5880]=23508,A[5879]=23508,A[5882]=23516,A[5881]=23516,A[5884]=23524,A[5883]=23524,A[5886]=23532,A[5885]=23532,A[5888]=23540,A[5887]=23540,A[5890]=23548,A[5889]=23548,A[5892]=23556,A[5891]=23556,A[5894]=23564,A[5893]=23564,A[5896]=23572,A[5895]=23572,A[5898]=23580,A[5897]=23580,A[5900]=23588,A[5899]=23588,A[5902]=23596,A[5901]=23596,A[5904]=23604,A[5903]=23604,A[5906]=23612,A[5905]=23612,A[5908]=23620,A[5907]=23620,A[5910]=23628,A[5909]=23628,A[5912]=23636,A[5911]=23636,A[5914]=23644,A[5913]=23644,A[5916]=23652,A[5915]=23652,A[5918]=23660,A[5917]=23660,A[5920]=23668,A[5919]=23668,A[5922]=23676,A[5921]=23676,A[5924]=23684,A[5923]=23684,A[5926]=23692,A[5925]=23692,A[5928]=23700,A[5927]=23700,A[5930]=23708,A[5929]=23708,A[5932]=23716,A[5931]=23716,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(w=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+w+4>>2]=40,A[5864]=A[5979]}while(0);if((n=0|A[5860])>>>0>h>>>0)return v=n-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0)}return A[(w=23424)>>2]=12,M=e,0|(w=0)}function Le(t){var e=0,n=0,r=0,i=0,o=0,s=0,a=0,u=0;if(t|=0){n=t+-8|0,i=0|A[5861],u=n+(e=-8&(t=0|A[t+-4>>2]))|0;do{if(1&t)a=n,s=n;else{if(r=0|A[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<i>>>0)return;if((0|A[5862])==(0|s)){if(3&~(e=0|A[(t=u+4|0)>>2])){a=s,e=o;break}return A[5859]=o,A[t>>2]=-2&e,A[s+4>>2]=1|o,void(A[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|A[s+8>>2],(0|(e=0|A[s+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<n),a=s,e=o;break}A[t+12>>2]=e,A[e+8>>2]=t,a=s,e=o;break}i=0|A[s+24>>2],t=0|A[s+12>>2];do{if((0|t)==(0|s)){if(t=0|A[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){t=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0}else a=0|A[s+8>>2],A[a+12>>2]=t,A[t+8>>2]=a}while(0);if(i){if(e=0|A[s+28>>2],(0|A[(n=23732+(e<<2)|0)>>2])==(0|s)){if(A[n>>2]=t,!t){A[5858]=A[5858]&~(1<<e),a=s,e=o;break}}else if(A[((0|A[(a=i+16|0)>>2])==(0|s)?a:i+20)>>2]=t,!t){a=s,e=o;break}A[t+24>>2]=i,0|(n=0|A[(e=s+16|0)>>2])&&(A[t+16>>2]=n,A[n+24>>2]=t),(e=0|A[e+4>>2])?(A[t+20>>2]=e,A[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|A[(t=u+4|0)>>2])){if(2&r)A[t>>2]=-2&r,A[a+4>>2]=1|e,A[s+e>>2]=e,i=e;else{if((0|A[5863])==(0|u)){if(u=(0|A[5860])+e|0,A[5860]=u,A[5863]=a,A[a+4>>2]=1|u,(0|a)!=(0|A[5862]))return;return A[5862]=0,void(A[5859]=0)}if((0|A[5862])==(0|u))return u=(0|A[5859])+e|0,A[5859]=u,A[5862]=s,A[a+4>>2]=1|u,void(A[s+u>>2]=u);i=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|A[u+8>>2],(0|(t=0|A[u+12>>2]))==(0|e)){A[5857]=A[5857]&~(1<<n);break}A[e+12>>2]=t,A[t+8>>2]=e;break}o=0|A[u+24>>2],t=0|A[u+12>>2];do{if((0|t)==(0|u)){if(t=0|A[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){n=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0,n=t}else n=0|A[u+8>>2],A[n+12>>2]=t,A[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|A[u+28>>2],(0|A[(e=23732+(t<<2)|0)>>2])==(0|u)){if(A[e>>2]=n,!n){A[5858]=A[5858]&~(1<<t);break}}else if(A[((0|A[(r=o+16|0)>>2])==(0|u)?r:o+20)>>2]=n,!n)break;A[n+24>>2]=o,0|(e=0|A[(t=u+16|0)>>2])&&(A[n+16>>2]=e,A[e+24>>2]=n),0|(t=0|A[t+4>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);if(A[a+4>>2]=1|i,A[s+i>>2]=i,(0|a)==(0|A[5862]))return void(A[5859]=i)}if(t=i>>>3,i>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|A[5857])&(t=1<<t)?t=0|A[(e=n+8|0)>>2]:(A[5857]=e|t,t=n,e=n+8|0),A[e>>2]=a,A[t+12>>2]=a,A[a+8>>2]=t,void(A[a+12>>2]=n);t=23732+((r=(t=i>>>8)?i>>>0>16777215?31:i>>>((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,A[a+28>>2]=r,A[a+20>>2]=0,A[a+16>>2]=0,e=0|A[5858],n=1<<r;t:do{if(e&n){t=0|A[t>>2];e:do{if((-8&A[t+4>>2])!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1));e=0|A[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&A[e+4>>2])==(0|i)){t=e;break e}r<<=1,t=e}A[n>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a;break t}}while(0);u=0|A[(s=t+8|0)>>2],A[u+12>>2]=a,A[s>>2]=a,A[a+8>>2]=u,A[a+12>>2]=t,A[a+24>>2]=0}else A[5858]=e|n,A[t>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a}while(0);if(u=(0|A[5865])-1|0,A[5865]=u,!(0|u)){for(t=23884;t=0|A[t>>2];)t=t+8|0;A[5865]=-1}}}}function Te(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|De(n))&&3&A[t+-4>>2]?(He(0|t,0,0|n),0|t):0|t}function Me(t,e,n,r){return 0|(I((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(I(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Re(t){return 0|((t|=0)?31-(0|b(t^t-1)):32)}function Pe(t,e,n,r,i){i|=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|i),a?o?(A[i>>2]=0|t,A[i+4>>2]=0,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i)):(o&&(A[i>>2]=(l>>>0)%(s>>>0),A[i+4>>2]=0),i=(l>>>0)/(s>>>0)>>>0,0|(I(0|(h=0)),i));o=!(0|a);do{if(s){if(!o){if((o=(0|b(0|a))-(0|b(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 i?(A[i>>2]=0|t,A[i+4>>2]=0|u,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i))}if((o=s-1|0)&s){s=a=33+(0|b(0|s))-(0|b(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|i&&(A[i>>2]=o&l,A[i+4>>2]=0),1==(0|s)?(d=0|t,0|(I(0|(p=0|u)),d)):(p=c>>>((d=0|Re(0|s))>>>0)|0,d=c<<32-d|l>>>(d>>>0),0|(I(0|p),d))}if(o)return 0|i&&(A[i>>2]=(c>>>0)%(s>>>0),A[i+4>>2]=0),d=(c>>>0)/(s>>>0)>>>0,0|(I(0|(p=0)),d);if(!l)return 0|i&&(A[i>>2]=0,A[i+4>>2]=(c>>>0)%(a>>>0)),d=(c>>>0)/(a>>>0)>>>0,0|(I(0|(p=0)),d);if(!((o=a-1|0)&a))return 0|i&&(A[i>>2]=0|t,A[i+4>>2]=o&c),p=0,d=c>>>((0|Re(0|a))>>>0),0|(I(0|p),d);if((o=(0|b(0|a))-(0|b(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 i?(A[i>>2]=0|t,A[i+4>>2]=0|u,d=0,0|(I(0|(p=0)),d)):(d=0,0|(I(0|(p=0)),d))}while(0);if(s){c=0|Me(0|(f=0|n),0|(l=0|h),-1,-1),n=0|C(),u=a,a=0;do{r=u,u=o>>>31|u<<1,o=a|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(h=t>>>31|e<<1)),a=1&(p=(d=0|C())>>31|((0|d)<0?-1:0)<<1),t=0|Oe(0|r,0|h,p&f,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l),e=0|C(),s=s-1|0}while(0|s);c=u,u=0}else c=a,u=0,a=0;return s=0,0|i&&(A[i>>2]=t,A[i+4>>2]=e),d=o<<1&-2|a,0|(I(0|(p=(0|o)>>>31|(c|s)<<1|u)),d)}function ke(t,e,n,r){n|=0;var A,i,o,s,a;return i=(r|=0)>>31|((0|r)<0?-1:0)<<1,A=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|s),t=i^a,e=A^s,0|Oe(Pe(o,0|C(),0|Oe(i^n,A^r,0|i,0|A),0|C(),0)^t,C()^e,0|t,0|e)}function Be(t,e,n,r){e|=0,r|=0;var A,i;return n=0|function(t,e){var n,r,A,i=0;return t=((n=0|v(i=65535&(e|=0),A=65535&(t|=0)))>>>16)+(0|v(i,r=t>>>16))|0,e=0|v(i=e>>>16,A),0|(I((t>>>16)+(0|v(i,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(A=t|=0,i=n|=0),t=0|C(),0|(I((0|v(e,i))+(0|v(r,A))+t|0),n)}function Fe(t,e,n,r){n|=0;var i,o,s,a,u,c;return i=M,M=M+16|0,a=0|i,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Pe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|C(),0|Oe(c^n,u^r,0|c,0|u),0|C(),a),r=0|Oe(A[a>>2]^s,A[a+4>>2]^o,0|s,0|o),n=0|C(),M=i,0|(I(0|n),r)}function Ge(t,e,n,r){var i,o;return o=M,M=M+16|0,Pe(t|=0,e|=0,n|=0,r|=0,i=0|o),M=o,0|(I(0|A[i+4>>2]),A[i>>2])}function Ue(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(I(0|((0|e)<0?-1:0)),e>>n-32)}function Qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(I(0),e>>>n-32|0)}function Ve(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(I(t<<n-32),0)}function ze(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+w(+t,+e)}function qe(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+E(+t,+e)}function Ye(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function je(t,e,n){t|=0,e|=0;var i,o,s=0;if((0|(n|=0))>=8192)return D(0|t,0|e,0|n),0|t;if(o=0|t,i=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&i)-64|0;(0|t)<=(0|s);)A[t>>2]=A[e>>2],A[t+4>>2]=A[e+4>>2],A[t+8>>2]=A[e+8>>2],A[t+12>>2]=A[e+12>>2],A[t+16>>2]=A[e+16>>2],A[t+20>>2]=A[e+20>>2],A[t+24>>2]=A[e+24>>2],A[t+28>>2]=A[e+28>>2],A[t+32>>2]=A[e+32>>2],A[t+36>>2]=A[e+36>>2],A[t+40>>2]=A[e+40>>2],A[t+44>>2]=A[e+44>>2],A[t+48>>2]=A[e+48>>2],A[t+52>>2]=A[e+52>>2],A[t+56>>2]=A[e+56>>2],A[t+60>>2]=A[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)A[t>>2]=A[e>>2],t=t+4|0,e=e+4|0}else for(n=i-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|i);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function He(t,e,n){e|=0;var i,o=0,s=0,a=0;if(i=(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&i)-64|0;(0|t)<=(0|s);)A[t>>2]=a,A[t+4>>2]=a,A[t+8>>2]=a,A[t+12>>2]=a,A[t+16>>2]=a,A[t+20>>2]=a,A[t+24>>2]=a,A[t+28>>2]=a,A[t+32>>2]=a,A[t+36>>2]=a,A[t+40>>2]=a,A[t+44>>2]=a,A[t+48>>2]=a,A[t+52>>2]=a,A[t+56>>2]=a,A[t+60>>2]=a,t=t+64|0;for(;(0|t)<(0|o);)A[t>>2]=a,t=t+4|0}for(;(0|t)<(0|i);)r[t|0]=e,t=t+1|0;return i-n|0}function Xe(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function $e(t){t|=0;var e,n,r;return r=0|S(),(0|t)>0&(0|(e=(n=0|A[s>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),N(12),-1):(0|e)>(0|r)&&!(0|L(0|e))?(N(12),-1):(A[s>>2]=e,0|n)}return{___divdi3:ke,___muldi3:Be,___remdi3:Fe,___uremdi3:Ge,_areNeighborCells:function(t,e,n,r,i){i|=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|(i=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return A[i>>2]=0,M=a,0|(i=0);if(c=0|Qe(0|t,0|e,52),C(),c&=15,f=0|Qe(0|n,0|r,52),C(),(0|c)!=(15&f))return M=a,0|(i=12);if(u=c+-1|0,c>>>0>1){Pt(t,e,u,s),Pt(n,r,u,o),l=0|A[(f=s)>>2],f=0|A[f+4>>2];t:do{if((0|l)==(0|A[o>>2])&&(0|f)==(0|A[o+4>>2])){u=0|Qe(0|t,0|e,0|(c=3*(15^c)|0)),C(),u&=7,c=0|Qe(0|n,0|r,0|c),C(),c&=7;do{if(!(0|u)|!(0|c))A[i>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|Bt(l,f)){u=5;break}if((0|A[15536+(u<<2)>>2])!=(0|c)&&(0|A[15568+(u<<2)>>2])!=(0|c))break t;A[i>>2]=1,u=0}}while(0);return M=a,0|(i=u)}}while(0)}c=(u=s)+56|0;do{A[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return O(t,e,1,s),u=(0|A[(e=s)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+8|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+16|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+24|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+32|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+40|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)?1:1&((0|A[(u=s+48|0)>>2])==(0|n)?(0|A[u+4>>2])==(0|r):0),A[i>>2]=u,M=a,0|(i=0)},_bitshift64Ashr:Ue,_bitshift64Lshr:Qe,_bitshift64Shl:Ve,_calloc:Te,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Xt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var i=0;return i=0|Qe(0|(t|=0),0|(e|=0),52),C(),(0|n)<16&(0|(i&=15))<=(0|n)?((0|i)<(0|n)&&(i=0|Ve(-1,-1,3+(3*(n+-1-i|0)|0)|0),i=0|Ve(0|~i,0|~C(),3*(15-n|0)|0),e=~C()&e,t&=~i),i=0|Ve(0|n,0,52),n=-15728641&e|C(),A[r>>2]=t|i,A[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var i,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(i=M,M=M+16|0,_=i,m=0|Qe(0|(t|=0),0|(e|=0),52),C(),m&=15,n>>>0>15)return M=i,0|(m=4);if((0|m)<(0|n))return M=i,0|(m=12);if((0|m)!=(0|n))if(s=0|Ve(0|n,0,52),s|=t,u=C()|-15728641&e,(0|m)>(0|n)){c=n;do{y=0|Ve(7,0,3*(14-c|0)|0),c=c+1|0,s|=y,u=C()|u}while((0|c)<(0|m));y=s}else y=s;else y=t,u=e;g=0|Qe(0|y,0|u,45),C();t:do{if(0|U(127&g)){if(c=0|Qe(0|y,0|u,52),C(),0|(c&=15))for(s=1;;){if(!(!((g=0|Ve(7,0,3*(15-s|0)|0))&y)&!(C()&u))){l=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(A[(g=r)>>2]=0,A[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|Ve(0|d,0,52),s|=t,c=C()|g,(0|m)<(0|p))h=s;else{l=d;do{h=0|Ve(7,0,3*(14-l|0)|0),l=l+1|0,s|=h,c=C()|c}while((0|l)<(0|m));h=s}else h=t,c=e;if(f=0|Qe(0|h,0|c,45),C(),0|U(127&f)){f=0|Qe(0|h,0|c,52),C(),f&=15;e:do{if(f)for(l=1;;){if(s=0|Qe(0|h,0|c,3*(15-l|0)|0),C(),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|Qe(0|t,0|e,3*(15-p|0)|0),C(),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|le(7,0,l=m-p|0,((0|l)<0)<<31>>31),f=0|C(),s?(s=0|Me(0|(s=0|Be(0|l,0|f,5,0)),0|C(),-5,-1),s=0|Me(0|(s=0|ke(0|s,0|C(),6,0)),0|C(),1,0),c=0|C()):(s=l,c=f),p=0|Me(0|s,0|c,0|(p=0|Be(0|l,0|f,0|(p=h+-1|0),((0|p)<0)<<31>>31)),0|C()),f=0|Me(0|p,0|(h=0|C()),0|A[(f=r)>>2],0|A[f+4>>2]),h=0|C(),A[(p=r)>>2]=f,A[p+4>>2]=h),(0|d)<=(0|n)){l=37;break}}if(19==(0|l))x(23313,22674,1099,22710);else{if(37==(0|l)){o=0|A[(a=r)+4>>2],a=0|A[a>>2];break}if(42==(0|l))return M=i,0|o}}else o=0,a=0}else l=33}while(0);t:do{if(33==(0|l)){if(A[(g=r)>>2]=0,A[g+4>>2]=0,(0|m)>(0|n)){for(s=m;;){if(o=0|Qe(0|t,0|e,3*(15-s|0)|0),C(),7==(0|(o&=7))){o=5;break}if(o=0|Be(0|(a=0|le(7,0,a=m-s|0,((0|a)<0)<<31>>31)),0|C(),0|o,0),a=0|C(),a=0|Me(0|A[(g=r)>>2],0|A[g+4>>2],0|o,0|a),o=0|C(),A[(g=r)>>2]=a,A[g+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return M=i,0|o}o=0,a=0}}while(0);return 0|kt(y,u,m,_)&&x(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&a>>>0>4294967295)&((0|(_=0|A[(m=_)+4>>2]))>(0|o)|((0|_)==(0|o)?(0|A[m>>2])>>>0>a>>>0:0))?(M=i,0|(m=0)):(x(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var i,o,s=0,a=0;if(o=M,M=M+16|0,Wt(i=o,t|=0,e|=0,n|=0),!(0|(t=0|A[(e=i)>>2]))&!(0|(e=0|A[e+4>>2])))return M=o,0;s=0,n=0;do{A[(a=r+(s<<3)|0)>>2]=t,A[a+4>>2]=e,s=0|Me(0|s,0|n,1,0),n=0|C(),Kt(i),t=0|A[(a=i)>>2],e=0|A[a+4>>2]}while(!(!(0|t)&!(0|e)));return M=o,0},_cellToChildrenSize:kt,_cellToLatLng:Ht,_cellToLocalIj:function(t,e,n,r,A,i){var o,s;return t|=0,e|=0,n|=0,r|=0,i|=0,s=M,M=M+16|0,o=s,(A|=0)?t=15:(t=0|ue(t,e,n,r,o))||(mt(o,i),t=0),M=s,0|t},_cellToParent:Pt,_cellToVertex:ve,_cellToVertexes:function(t,e,n){n|=0;var r,i=0,o=0;return o=!(0|Bt(t|=0,e|=0)),r=!(0|(i=0|ve(t,e,0,n))),o?r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||(i=0|ve(t,e,4,n+32|0))?0|(o=i):0|ve(t,e,5,n+40|0):0|(o=i):r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||0|(i=0|ve(t,e,4,n+32|0))?0|(o=i):(A[(o=n+40|0)>>2]=0,A[o+4>>2]=0,0|(o=0)):0|(o=i)},_cellsToDirectedEdge:function(t,e,n,r,i){return i|=0,7==(0|(n=0|F(t|=0,e|=0,n|=0,r|=0)))?0|(i=11):(r=0|Ve(0|n,0,56),e=-2130706433&e|C()|268435456,A[i>>2]=t|r,A[i+4>>2]=e,0|(i=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,i,o,s=0;if(o=M,M=M+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+176|0,r=i,(0|(e|=0))<1)return Ee(n,0,0),M=i,0;for(c=0|Qe(0|A[(c=t)>>2],0|A[c+4>>2],52),C(),Ee(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Xt(0|A[(o=t+(c<<3)|0)>>2],0|A[o+4>>2],r)));){if((0|(o=0|A[r>>2]))>0){u=0;do{a=r+8+(u<<4)|0,(s=0|xe(n,o=r+8+((0|(u=u+1|0))%(0|o)<<4)|0,a))?Ie(n,s):Ce(n,a,o),o=0|A[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=i,0|o):(we(n),M=i,0|(l=o))}(t|=0,e|=0,i=o+16|0),0|t)return M=o,0|(n=t);if(A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,0|(t=0|be(i)))do{e=0|Ae(n);do{ie(e,t),s=t+16|0,A[r>>2]=A[s>>2],A[r+4>>2]=A[s+4>>2],A[r+8>>2]=A[s+8>>2],A[r+12>>2]=A[s+12>>2],Ie(i,t),t=0|Ne(i,r)}while(0|t);t=0|be(i)}while(0|t);return we(i),(t=0|se(n))?(oe(n),M=o,0|(s=t)):(M=o,0|(s=0))},_childPosToCell:function(t,e,n,r,i,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,(i|=0)>>>0>15)return M=s,0|(o=4);if(u=0|Qe(0|(n|=0),0|(r|=0),52),C(),(0|(u&=15))>(0|i))return M=s,0|(o=12);if(0|kt(n,r,i,a)&&x(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(l=0|A[(f=a)+4>>2]))>(0|e)|((0|l)==(0|e)?(0|A[f>>2])>>>0>t>>>0:0))))return M=s,0|(o=2);f=i-u|0,i=0|Ve(0|i,0,52),c=C()|-15728641&r,A[(l=o)>>2]=i|n,A[l+4>>2]=c,l=0|Qe(0|n,0|r,45),C();t:do{if(0|U(127&l)){if(0|u)for(a=1;;){if(!(!((l=0|Ve(7,0,3*(15-a|0)|0))&n)&!(C()&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|le(7,0,u=f-c|0,((0|u)<0)<<31>>31),n=0|C();do{if(a){if(a=0|ke(0|(a=0|Me(0|(a=0|Be(0|u,0|n,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(i=0|C()))|(0|e)==(0|i)&t>>>0>a>>>0){e=0|Oe(0|(e=0|Me(0|t,0|e,-1,-1)),0|C(),0|a,0|i),a=0|C(),d=0|A[(h=o)>>2],h=0|A[h+4>>2],p=0|Ve(7,0,0|(g=3*(l+r|0)|0)),h&=~C(),g=0|Ve(0|(i=0|Me(0|(r=0|ke(0|e,0|a,0|u,0|n)),0|(t=0|C()),2,0)),0|C(),0|g),h=C()|h,A[(i=o)>>2]=g|d&~p,A[i+4>>2]=h,t=0|Oe(0|e,0|a,0|(t=0|Be(0|r,0|t,0|u,0|n)),0|C()),a=0,e=0|C();break}p=0|A[(g=o)>>2],g=0|A[g+4>>2],d=0|Ve(7,0,3*(l+r|0)|0),g&=~C(),A[(a=o)>>2]=p&~d,A[a+4>>2]=g,a=1;break}i=0|A[(p=o)>>2],p=0|A[p+4>>2],h=0|Ve(7,0,0|(r=3*(l+r|0)|0)),p&=~C(),r=0|Ve(0|(g=0|ke(0|t,0|e,0|u,0|n)),0|(a=0|C()),0|r),p=C()|p,A[(d=o)>>2]=r|i&~h,A[d+4>>2]=p,t=0|Oe(0|t,0|e,0|(a=0|Be(0|g,0|a,0|u,0|n)),0|C()),a=0,e=0|C()}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(i=15^u,a=1;;){if(d=0|le(7,0,d=f-a|0,((0|d)<0)<<31>>31),g=0|C(),n=0|A[(c=o)>>2],c=0|A[c+4>>2],r=0|Ve(7,0,0|(u=3*(i-a|0)|0)),c&=~C(),u=0|Ve(0|(h=0|ke(0|t,0|e,0|d,0|g)),0|(p=0|C()),0|u),c=C()|c,A[(l=o)>>2]=u|n&~r,A[l+4>>2]=c,t=0|Oe(0|t,0|e,0|(g=0|Be(0|h,0|p,0|d,0|g)),0|C()),e=0|C(),(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 i,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,E=0,w=0,b=0,I=0,N=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(I=0);if(s=0|A[(o=t|=0)>>2],!0&!(15728640&(o=0|A[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(I=0);if(A[(I=e)>>2]=s,A[I+4>>2]=o,1==(0|n)&!(0|r))return 0|(I=0);o=1;do{b=0|A[(w=t+(o<<3)|0)+4>>2],A[(I=e+(o<<3)|0)>>2]=A[w>>2],A[I+4>>2]=b,o=o+1|0}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(b=0|De(i=n<<3)))return 0|(I=13);if(je(0|b,0|t,0|i),!(w=0|Te(n,8)))return Le(b),0|(I=13);t:do{if(0|n){e:for(;;){v=0|Qe(0|(m=0|A[(o=b)>>2]),0|(o=0|A[o+4>>2]),52),C(),E=(v&=15)+-1|0,_=(0|n)>0;n:do{if(!!(0|v)&_){if(d=((0|n)<0)<<31>>31,g=0|Ve(0|E,0,52),y=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){I=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(y=0|A[(r=b+(s<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){o=r,I=17;break e}}}for(s=0,t=m,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){I=22;break e}if(u=0|Qe(0|t,0|r,52),C(),(0|(u&=15))<(0|E)){o=12,I=28;break e}if((0|u)!=(0|E)&&(t|=g,r=-15728641&r|y,u>>>0>=v>>>0)){a=E;do{p=0|Ve(7,0,3*(14-a|0)|0),a=a+1|0,t|=p,r=C()|r}while(a>>>0<u>>>0)}if(a=0|Ge(0|t,0|r,0|n,0|d),C(),!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2])))a=l;else for(p=0;;){if((0|p)>(0|n)){I=32;break e}if((0|c)==(0|t)&(-117440513&u)==(0|r)){f=0|Qe(0|c,0|u,56),C(),h=(f&=7)+1|0,N=0|Qe(0|c,0|u,45),C();r:do{if(0|U(127&N)){if(c=0|Qe(0|c,0|u,52),C(),!(c&=15)){u=6;break}for(u=1;;){if(!(!((N=0|Ve(7,0,3*(15-u|0)|0))&t)&!(C()&r))){u=7;break r}if(!(u>>>0<c>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((f+2|0)>>>0>u>>>0){I=42;break e}N=0|Ve(0|h,0,56),r=C()|-117440513&r,A[(h=l)>>2]=0,A[h+4>>2]=0,t|=N}else a=(a+1|0)%(0|n)|0;if(!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2]))){a=l;break}p=p+1|0}A[(N=a)>>2]=t,A[N+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|A[(r=b+(s<<3)|0)>>2],r=0|A[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){I=85;break}if(!(y=0|Te((0|n)/6|0,8))){I=49;break}n:do{if(_){p=0,h=0;do{if(!(!(0|(s=0|A[(r=u=w+(p<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){c=0|Qe(0|s,0|r,56),C(),t=(c&=7)+1|0,l=-117440513&r,N=0|Qe(0|s,0|r,45),C();r:do{if(0|U(127&N)){if(f=0|Qe(0|s,0|r,52),C(),0|(f&=15))for(a=1;;){if(!(!(s&(N=0|Ve(7,0,3*(15-a|0)|0)))&!(l&C())))break r;if(!(a>>>0<f>>>0))break;a=a+1|0}s|=r=0|Ve(0|t,0,56),r=C()|l,A[(t=u)>>2]=s,A[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(A[(N=y+(h<<3)|0)>>2]=s,A[N+4>>2]=-117440513&r,h=h+1|0)}p=p+1|0}while((0|p)!=(0|n));if(_){if(p=((0|n)<0)<<31>>31,d=0|Ve(0|E,0,52),g=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){o=4,I=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=h;break n}if(!(!(0|A[(N=b+(o<<3)|0)>>2])&!(0|A[N+4>>2]))){o=4,I=84;break e}}}for(f=0,s=0,l=m;;){do{if(!(!(0|l)&!(0|o))){if(u=0|Qe(0|l,0|o,52),C(),(0|(u&=15))<(0|E)){o=12,I=84;break e}do{if((0|u)==(0|E))r=l,u=o;else{if(r=l|d,t=-15728641&o|g,u>>>0<v>>>0){u=t;break}a=E;do{N=0|Ve(7,0,3*(14-a|0)|0),a=a+1|0,r|=N,t=C()|t}while(a>>>0<u>>>0);u=t}}while(0);for(a=0|Ge(0|r,0|u,0|n,0|p),C(),t=0;;){if((0|t)>(0|n)){I=77;break e}if((-117440513&(c=0|A[(N=w+(a<<3)|0)+4>>2]))==(0|u)&&(0|A[N>>2])==(0|r)){I=79;break}if((0|A[(N=w+((a=(a+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|A[N+4>>2])==(0|u))break;t=t+1|0}if(79==(0|I)&&(I=0,!0&100663296==(117440512&c)))break;A[(N=e+(s<<3)|0)>>2]=l,A[N+4>>2]=o,s=s+1|0}}while(0);if((0|(o=f+1|0))>=(0|n)){o=h;break n}f=o,l=0|A[(N=b+(o<<3)|0)>>2],o=0|A[N+4>>2]}}else s=0,o=h}else s=0,o=0}while(0);if(He(0|w,0,0|i),je(0|b,0|y,o<<3),Le(y),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|I))!0&!(117440512&o)?(o=4,I=28):I=22;else if(32==(0|I))x(23313,22674,362,22684);else{if(42==(0|I))return Le(b),Le(w),0|(N=10);if(49==(0|I))return Le(b),Le(w),0|(N=13);if(77==(0|I))x(23313,22674,462,22684);else{if(84==(0|I))return Le(y),Le(b),Le(w),0|(N=o);if(85==(0|I)){je(0|e,0|b,n<<3);break}}}if(22==(0|I))return Le(b),Le(w),0|(N=5);if(28==(0|I))return Le(b),Le(w),0|(N=o)}}while(0);return Le(b),Le(w),0|(N=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:bt,_directedEdgeToCells:function(t,e,n){t|=0;var r,i,o,s=0;return r=M,M=M+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(i=-2130706433&e|134217728,A[(o=n|=0)>>2]=t,A[o+4>>2]=i,A[s>>2]=0,e=0|Qe(0|t,0|e,56),C(),s=0|B(t,i,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|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[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 i[n>>3]=a,u=0,d=a,d*=6371.007180918475,i[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|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[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 i[n>>3]=a,u=0,d=a,d*=6371.007180918475,d*=1e3,i[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|bt(t|=0,e|=0,u=r)))return M=r,0|(u=t);if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return M=r,0|(u=0);e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[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 i[n>>3]=a,M=r,0|(u=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),A=new Int32Array(t),i=new Float64Array(t),n=t,!0},_free:Le,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,i,o=0;return r=M,M=M+16|0,A[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(i=0|Qe(0|t,0|e,56),C(),o=0|B(t,-2130706433&e|134217728,7&i,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))?(A[n>>2]=t,A[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;i=M,M=M+128|0,f=i+112|0,a=i+96|0,h=i,s=0|Qe(0|(e|=0),0|(n|=0),52),C(),c=15&s,A[f>>2]=c,u=0|Qe(0|e,0|n,45),C(),u&=127;t:do{if(0|U(u)){if(0|c)for(o=1;;){if(!(!((l=0|Ve(7,0,3*(15-o|0)|0))&e)&!(C()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return l=0|Ve(c+1|0,0,52),h=C()|-15728641&n,h=0|t((l|e)&~(f=0|Ve(7,0,3*(14-c|0)|0)),h&~C(),r),M=i,0|h;s=1}else s=0}while(0);if(!(o=0|jt(e,n,a))){s?(St(a,f,h),l=5):(Mt(a,f,h),l=6);t:do{if(0|U(u))if(c)for(o=1;;){if(!(!((u=0|Ve(7,0,3*(15-o|0)|0))&e)&!(C()&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);He(0|r,-1,e<<2);t:do{if(s)for(a=0;;){if(Lt(u=h+(a<<4)|0,0|A[f>>2]),u=0|A[u>>2],-1==(0|(c=0|A[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|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}else for(a=0;;){if(Dt(u=h+(a<<4)|0,0|A[f>>2],0,1),u=0|A[u>>2],-1==(0|(c=0|A[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|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}}while(0)}return M=i,0|(h=o)},_getNumCells:ee,_getPentagons:$t,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Ve(0|e,0,45),r=134225919|C(),A[(n=t+(e<<3)|0)>>2]=-1,A[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[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,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:R,_gridDistance:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s,a=0,u=0;return s=M,M=M+32|0,u=s,0|(o=0|ue(t|=0,e|=0,t,e,a=s+12|0))?(M=s,0|(u=o)):0|(t=0|ue(t,e,n,r,u))?(M=s,0|(u=t)):(a=0|_t(a,u),A[(u=i)>>2]=a,A[u+4>>2]=((0|a)<0)<<31>>31,M=s,0|(u=0))},_gridPathCells:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,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,E=0,w=0,b=0,I=0,N=0,S=0;if(o=M,M=M+48|0,c=o+12|0,N=o,!(s=0|ue(t|=0,e|=0,t,e,a=o+24|0))&&!(s=0|ue(t,e,n,r,c))){I=((0|(b=0|_t(a,c)))<0)<<31>>31,A[a>>2]=0,A[a+4>>2]=0,A[a+8>>2]=0,A[c>>2]=0,A[c+4>>2]=0,A[c+8>>2]=0,0|ue(t,e,t,e,a)&&x(23313,23090,691,23299),0|ue(t,e,n,r,c)&&x(23313,23090,696,23299),Et(a),Et(c),b?(y=+(0|b),w=a,r=p=0|A[a>>2],s=d=0|A[(v=a+4|0)>>2],n=g=0|A[(E=a+8|0)>>2],_=+((0|A[c>>2])-p|0)/y,m=+((0|A[c+4>>2])-d|0)/y,y=+((0|A[c+8>>2])-g|0)/y):(v=s=a+4|0,E=n=a+8|0,w=a,r=0|A[a>>2],s=0|A[s>>2],n=0|A[n>>2],_=0,m=0,y=0),A[N>>2]=r,A[(g=N+4|0)>>2]=s,A[(d=N+8|0)>>2]=n;t:do{if((0|b)<0)s=0;else for(h=0,p=0,s=r;;){S=_*(f=+(p>>>0)+4294967296*+(0|h))+ +(0|s),l=m*f+ +(0|A[v>>2]),f=y*f+ +(0|A[E>>2]),n=~~+Ye(+S),a=~~+Ye(+l),s=~~+Ye(+f),S=+u(+(+(0|n)-S)),l=+u(+(+(0|a)-l)),f=+u(+(+(0|s)-f));do{if(!(S>l&S>f)){if(c=0-n|0,l>f){r=c-s|0;break}r=a,s=c-a|0;break}n=0-(a+s)|0,r=a}while(0);if(A[N>>2]=n,A[g>>2]=r,A[d>>2]=s,wt(N),0|(s=0|ce(t,e,N,i+(p<<3)|0)))break t;if(!((0|h)<(0|I)|(0|h)==(0|I)&p>>>0<b>>>0)){s=0;break t}s=0|Me(0|p,0|h,1,0),h=c=0|C(),p=s,s=0|A[w>>2]}}while(0);return M=o,0|(N=s)}return M=o,0|(N=s)},_gridPathCellsSize:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s=0,a=0,u=0;return o=M,M=M+32|0,u=o,(s=0|ue(t|=0,e|=0,t,e,a=o+12|0))||(s=0|ue(t,e,n,r,u))?(M=o,0|(u=s)):(r=0|Me(0|(r=0|_t(a,u)),((0|r)<0)<<31>>31,1,0),a=0|C(),A[(u=i)>>2]=r,A[u+4>>2]=a,M=o,0|(u=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var i,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,A[(p=i=o)>>2]=t,A[p+4>>2]=e,!n)return A[(d=r)>>2]=t,A[d+4>>2]=e,M=o,0|(d=0);A[d>>2]=0;t:do{if(0|Bt(t,e))t=9;else{if(a=(0|n)>0){s=0,p=t;do{if(0|(t=0|B(p,e,4,d,i)))break t;if(s=s+1|0,0|Bt(p=0|A[(e=i)>>2],e=0|A[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(A[(h=r)>>2]=p,A[h+4>>2]=e,h=n+-1|0,a){f=0,t=1;do{if(s=22384+(f<<2)|0,5==(0|f))for(u=0|A[s>>2],a=0,s=t;;){if(0|(t=0|B(0|A[(t=i)>>2],0|A[t+4>>2],u,d,i)))break t;if((0|a)!=(0|h)){if(c=0|A[(l=i)>>2],l=0|A[l+4>>2],A[(t=r+(s<<3)|0)>>2]=c,A[t+4>>2]=l,0|Bt(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=i,l=0|A[s>>2],c=0,s=t,a=0|A[u>>2],u=0|A[u+4>>2];;){if(0|(t=0|B(a,u,l,d,i)))break t;if(a=0|A[(u=i)>>2],u=0|A[u+4>>2],A[(t=r+(s<<3)|0)>>2]=a,A[t+4>>2]=u,t=s+1|0,0|Bt(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);u=p,s=0|A[(t=i)>>2],a=e,t=0|A[t+4>>2]}else u=p,s=p,a=e,t=e}else A[(u=r)>>2]=t,A[u+4>>2]=e,u=t,s=t,a=e,t=e;t=(0|u)==(0|s)&(0|a)==(0|t)?0:9}}while(0);return M=o,0|(d=t)},_i64Add:Me,_i64Subtract:Oe,_isPentagon:Bt,_isResClassIII:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),1&e},_isValidCell:Rt,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|Qe(0|(t|=0),0|(e|=0),56),C(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Bt(t,n))?0|(n=0):0|(n=0|Rt(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,i=0,o=0;return r=M,M=M+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|Rt(t,i=-2130706433&e|134217728)?(o=0|Qe(0|t,0|e,56),C(),i=(o=!(0|ve(t,i,7&o,n)))&((0|A[(i=n)>>2])==(0|t)?(0|A[i+4>>2])==(0|e):0)&1,M=r,0|i):(M=r,0|(i=0))},_latLngToCell:qt,_llvm_maxnum_f64:ze,_llvm_minnum_f64:qe,_llvm_round_f64:Ye,_localIjToCell:function(t,e,n,r,A){var i,o;return t|=0,e|=0,n|=0,A|=0,o=M,M=M+16|0,i=o,(r|=0)?n=15:(n=0|vt(n,i))||(n=0|ce(t,e,i,A)),M=o,0|n},_malloc:De,_maxFaceCount:function(t,e,n){n|=0;var r=0,i=0;if(i=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&i)))return i=2,A[n>>2]=i,0;if(i=0|Qe(0|t,0|e,52),C(),!(i&=15))return i=5,A[n>>2]=i,0;for(r=1;;){if(!(!((0|Ve(7,0,3*(15-r|0)|0))&t)&!(C()&e))){r=2,t=6;break}if(!(r>>>0<i>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(A[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,i=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(i=0|Be(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|C(),n=0|Me(0|t,0|n,1,0),n=0|Me(0|(n=0|Be(0|i,0|r,0|n,0|C())),0|C(),1,0),t=0|C(),A[e>>2]=n,A[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var i,o=0,s=0,a=0,u=0,c=0;if(i=M,M=M+48|0,o=i+16|0,s=i+8|0,a=i,0|(n|=0))return M=i,0|(a=15);if(u=0|A[(c=t|=0)+4>>2],A[(n=s)>>2]=A[c>>2],A[n+4>>2]=u,he(s,o),!(e=0|$(o,e,a))){if(n=0|A[s>>2],(0|(s=0|A[t+8>>2]))>0){o=0|A[t+12>>2],e=0;do{n=(0|A[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|A[(e=a)>>2],(0|(e=0|A[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(A[(e=a)>>2]=n,A[e+4>>2]=s,e=s):n=o,u=0|Me(0|n,0|e,12,0),c=0|C(),A[(e=a)>>2]=u,A[e+4>>2]=c,A[(e=r)>>2]=u,A[e+4>>2]=c,e=0}return M=i,0|(c=e)},_memcpy:je,_memset:He,_originToDirectedEdges:function(t,e,n){n|=0;var r,i=0;return r=!(0|Bt(t|=0,e|=0)),e&=-2130706433,A[(i=n)>>2]=r?t:0,A[i+4>>2]=r?285212672|e:0,A[(i=n+8|0)>>2]=t,A[i+4>>2]=301989888|e,A[(i=n+16|0)>>2]=t,A[i+4>>2]=318767104|e,A[(i=n+24|0)>>2]=t,A[i+4>>2]=335544320|e,A[(i=n+32|0)>>2]=t,A[i+4>>2]=352321536|e,A[(n=n+40|0)>>2]=t,A[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var i,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,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,R=0,B=0,F=0,U=0;if(a=M,M=M+112|0,i=a+80|0,h=a+72|0,o=a,s=a+56|0,0|(n|=0))return M=a,0|(U=15);if(!(U=0|De(32+(A[(p=(t|=0)+8|0)>>2]<<5)|0)))return M=a,0|(U=13);if(pe(t,U),F=0|A[(B=t)+4>>2],A[(n=h)>>2]=A[B>>2],A[n+4>>2]=F,he(h,i),n=0|$(i,e,o))B=0,F=0;else{if(n=0|A[h>>2],(0|(c=0|A[p>>2]))>0){l=0|A[t+12>>2],u=0;do{n=(0|A[l+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|c));u=n}else u=n;c=0|A[(n=o)>>2],(0|(n=0|A[n+4>>2]))<(0|(l=((0|u)<0)<<31>>31))|(0|n)==(0|l)&c>>>0<u>>>0?(A[(n=o)>>2]=u,A[n+4>>2]=l,n=l):u=c,B=0|Me(0|u,0|n,12,0),F=0|C(),A[(n=o)>>2]=B,A[n+4>>2]=F,n=0}if(0|n)return Le(U),M=a,0|(U=n);if(!(u=0|Te(B,8)))return Le(U),M=a,0|(U=13);if(!(f=0|Te(B,8)))return Le(U),Le(u),M=a,0|(U=13);A[(O=i)>>2]=0,A[O+4>>2]=0,R=0|A[(O=t)+4>>2],A[(n=h)>>2]=A[O>>2],A[n+4>>2]=R,n=0|G(h,B,F,e,i,u,f);t:do{if(n)Le(u),Le(f),Le(U);else{e:do{if((0|A[p>>2])>0){for(l=t+12|0,c=0;n=0|G((0|A[l>>2])+(c<<3)|0,B,F,e,i,u,f),c=c+1|0,!(0|n);)if((0|c)>=(0|A[p>>2]))break e;Le(u),Le(f),Le(U);break t}}while(0);(0|F)>0|!(0|F)&B>>>0>0&&He(0|f,0,B<<3),O=0|A[(R=i)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|A[R>>2])>>>0>0){D=u,L=f,T=u,O=f,R=u,n=u,x=u,N=f,S=f,u=f;n:for(;;){for(E=0,w=0,b=0,I=0,c=0,l=0;;){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));if(0|P(p=0|A[(e=D+(E<<3)|0)>>2],e=0|A[e+4>>2],1,o,0)){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));0|(f=0|Te(7,4))&&(k(p,e,1,o,f,7,0,0),Le(f))}for(v=0;;){_=0|A[(m=o+(v<<3)|0)>>2],m=0|A[m+4>>2];r:do{if(!(0|_)&!(0|m))f=c,h=l;else{if(d=0|Ge(0|_,0|m,0|B,0|F),p=0|C(),!(!(0|(h=0|A[(e=f=r+(d<<3)|0)>>2]))&!(0|(e=0|A[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|Fe(0|(f=0|Me(0|d,0|p,1,0)),0|C(),0|B,0|F),p=0|C(),y=0|Me(0|y,0|g,1,0),g=0|C(),h=0|A[(e=f=r+(d<<3)|0)>>2],e=0|A[e+4>>2]}while(!(!(0|h)&!(0|e)))}!(0|_)&!(0|m)?(f=c,h=l):(Ht(_,m,s),0|de(t,U,s)&&(y=0|Me(0|c,0|l,1,0),l=0|C(),A[(g=f)>>2]=_,A[g+4>>2]=m,A[(c=L+(c<<3)|0)>>2]=_,A[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(E=0|Me(0|E,0|w,1,0),w=0|C(),b=0|Me(0|b,0|I,1,0),I=0|C(),c=0|A[(l=i)>>2],!((0|I)<(0|(l=0|A[l+4>>2]))|(0|I)==(0|l)&b>>>0<c>>>0))break;c=f,l=h}if((0|l)>0|!(0|l)&c>>>0>0){c=0,l=0;do{A[(I=D+(c<<3)|0)>>2]=0,A[I+4>>2]=0,c=0|Me(0|c,0|l,1,0),l=0|C(),b=0|A[(I=i)+4>>2]}while((0|l)<(0|b)|((0|l)==(0|b)?c>>>0<(0|A[I>>2])>>>0:0))}if(A[(I=i)>>2]=f,A[I+4>>2]=h,!((0|h)>0|!(0|h)&f>>>0>0))break e;v=u,E=S,w=R,b=N,I=L,u=x,S=n,N=T,x=v,n=E,R=O,O=w,T=b,L=D,D=I}Le(T),Le(O),Le(U),n=1;break t}n=f}while(0);Le(U),Le(u),Le(n),n=0}}while(0);return M=a,0|(U=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|A[(t|=0)>>2])>>>0)+4294967296*+(0|A[t+4>>2]))},_res0CellCount:function(){return 122},_round:Xe,_sbrk:$e,_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,i,o,s){t|=0,r|=0,i|=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|Qe(0|(c=0|A[(l=t+(p<<3)|0)>>2]),0|(l=0|A[l+4>>2]),52),C(),(15&f)>(0|s)){u=12,c=11;break}if(Wt(g,c,l,s),!(0|(l=0|A[(f=g)>>2]))&!(0|(f=0|A[f+4>>2])))c=h;else{c=h;do{if(!((0|u)<(0|o)|(0|u)==(0|o)&c>>>0<i>>>0)){c=10;break t}A[(h=r+(c<<3)|0)>>2]=l,A[h+4>>2]=f,c=0|Me(0|c,0|u,1,0),u=0|C(),Kt(g),l=0|A[(h=g)>>2],f=0|A[h+4>>2]}while(!(!(0|l)&!(0|f)))}if(p=0|Me(0|p,0|d,1,0),!((0|(d=0|C()))<(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,i){t|=0,e|=0,n|=0,r|=0,i|=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|A[(l=t+(f<<3)|0)>>2]))&!(0|(l=0|A[l+4>>2]))||(l=!(0|kt(c,l,r,o)),u=0|Me(0|A[(c=o)>>2],0|A[c+4>>2],0|u,0|a),a=0|C(),l))){a=12;break}if(f=0|Me(0|f,0|h,1,0),!((0|(h=0|C()))<(0|n)|(0|h)==(0|n)&f>>>0<e>>>0))break t}return M=s,0|a}u=0,a=0}while(0);return A[i>>2]=u,A[i+4>>2]=a,M=s,0|(i=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,i,o,s,a=0,u=0;return s=M,M=M+192|0,i=s,o=s+168|0,a=0|Qe(0|(t|=0),0|(e|=0),56),C(),a&=7,0|(r=0|jt(t,u=-2130706433&e|134217728,o))?(M=s,0|(u=r)):(e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,u)?Nt(o,e,a,1,i):Tt(o,e,a,1,i),u=i+8|0,A[n>>2]=A[u>>2],A[n+4>>2]=A[u+4>>2],A[n+8>>2]=A[u+8>>2],A[n+12>>2]=A[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},{a:yt,b:function(t){y=t},c:function(){return y},d:function(t,e,n,r){yt("Assertion failed: "+L(t)+", at: "+[e?L(e):"unknown filename",n,r?L(r):"unknown function"])},e:function(t){return n.___errno_location&&(x[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){I.set(I.subarray(e,e+n),t)},h:function(t){var e=J(),n=16777216,r=2130706432;if(t>r)return!1;for(var A=Math.max(e,16777216);A<t;)A=A<=536870912?T(2*A,n):Math.min(T((3*A+2147483648)/4,n),r);return!!tt(A)},i:function(t){yt("OOM")},j:W,k:K,l:tt,m:Z,n:function(){var t=Z();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),K(t)},o:24144,p:24128},w);n.___divdi3=At.___divdi3,n.___muldi3=At.___muldi3,n.___remdi3=At.___remdi3,n.___uremdi3=At.___uremdi3,n._areNeighborCells=At._areNeighborCells,n._bitshift64Ashr=At._bitshift64Ashr,n._bitshift64Lshr=At._bitshift64Lshr,n._bitshift64Shl=At._bitshift64Shl,n._calloc=At._calloc,n._cellAreaKm2=At._cellAreaKm2,n._cellAreaM2=At._cellAreaM2,n._cellAreaRads2=At._cellAreaRads2,n._cellToBoundary=At._cellToBoundary,n._cellToCenterChild=At._cellToCenterChild,n._cellToChildPos=At._cellToChildPos,n._cellToChildren=At._cellToChildren,n._cellToChildrenSize=At._cellToChildrenSize,n._cellToLatLng=At._cellToLatLng,n._cellToLocalIj=At._cellToLocalIj,n._cellToParent=At._cellToParent,n._cellToVertex=At._cellToVertex,n._cellToVertexes=At._cellToVertexes,n._cellsToDirectedEdge=At._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=At._cellsToLinkedMultiPolygon,n._childPosToCell=At._childPosToCell,n._compactCells=At._compactCells,n._destroyLinkedMultiPolygon=At._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=At._directedEdgeToBoundary,n._directedEdgeToCells=At._directedEdgeToCells,n._edgeLengthKm=At._edgeLengthKm,n._edgeLengthM=At._edgeLengthM,n._edgeLengthRads=At._edgeLengthRads;var it=n._emscripten_replace_memory=At._emscripten_replace_memory;n._free=At._free,n._getBaseCellNumber=At._getBaseCellNumber,n._getDirectedEdgeDestination=At._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=At._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=At._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=At._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=At._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=At._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=At._getIcosahedronFaces,n._getNumCells=At._getNumCells,n._getPentagons=At._getPentagons,n._getRes0Cells=At._getRes0Cells,n._getResolution=At._getResolution,n._greatCircleDistanceKm=At._greatCircleDistanceKm,n._greatCircleDistanceM=At._greatCircleDistanceM,n._greatCircleDistanceRads=At._greatCircleDistanceRads,n._gridDisk=At._gridDisk,n._gridDiskDistances=At._gridDiskDistances,n._gridDistance=At._gridDistance,n._gridPathCells=At._gridPathCells,n._gridPathCellsSize=At._gridPathCellsSize,n._gridRingUnsafe=At._gridRingUnsafe,n._i64Add=At._i64Add,n._i64Subtract=At._i64Subtract,n._isPentagon=At._isPentagon,n._isResClassIII=At._isResClassIII,n._isValidCell=At._isValidCell,n._isValidDirectedEdge=At._isValidDirectedEdge,n._isValidVertex=At._isValidVertex,n._latLngToCell=At._latLngToCell,n._llvm_maxnum_f64=At._llvm_maxnum_f64,n._llvm_minnum_f64=At._llvm_minnum_f64,n._llvm_round_f64=At._llvm_round_f64,n._localIjToCell=At._localIjToCell,n._malloc=At._malloc,n._maxFaceCount=At._maxFaceCount,n._maxGridDiskSize=At._maxGridDiskSize,n._maxPolygonToCellsSize=At._maxPolygonToCellsSize,n._memcpy=At._memcpy,n._memset=At._memset,n._originToDirectedEdges=At._originToDirectedEdges,n._pentagonCount=At._pentagonCount,n._polygonToCells=At._polygonToCells,n._readInt64AsDoubleFromPointer=At._readInt64AsDoubleFromPointer,n._res0CellCount=At._res0CellCount,n._round=At._round,n._sbrk=At._sbrk,n._sizeOfCellBoundary=At._sizeOfCellBoundary,n._sizeOfCoordIJ=At._sizeOfCoordIJ,n._sizeOfGeoLoop=At._sizeOfGeoLoop,n._sizeOfGeoPolygon=At._sizeOfGeoPolygon,n._sizeOfH3Index=At._sizeOfH3Index,n._sizeOfLatLng=At._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=At._sizeOfLinkedGeoPolygon,n._uncompactCells=At._uncompactCells,n._uncompactCellsSize=At._uncompactCellsSize,n._vertexToLatLng=At._vertexToLatLng,n.establishStackSpace=At.establishStackSpace;var ot,st,at=n.stackAlloc=At.stackAlloc,ut=n.stackRestore=At.stackRestore,ct=n.stackSave=At.stackSave;if(n.asm=At,n.cwrap=function(t,e,n,r){var A=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&A&&!r?v(t):function(){return E(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":b[t|0]=e;break;case"i16":C[t>>1]=e;break;case"i32":x[t>>2]=e;break;case"i64":j=[e>>>0,(Y=e,+G(Y)>=1?Y>0?(0|V(+Q(Y/4294967296),4294967295))>>>0:~~+U((Y-+(~~Y>>>0))/4294967296)>>>0:0)],x[t>>2]=j[0],x[t+4>>2]=j[1];break;case"float":N[t>>2]=e;break;case"double":S[t>>3]=e;break;default:yt("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 b[t|0];case"i16":return C[t>>1];case"i32":case"i64":return x[t>>2];case"float":return N[t>>2];case"double":return S[t>>3];default:yt("invalid type for getValue: "+e)}return null},H)if($(H)||(ot=H,H=n.locateFile?n.locateFile(ot,p):p+ot),a||s){var lt=l(H);I.set(lt,8)}else{z++,n.monitorRunDependencies&&n.monitorRunDependencies(z);var ft=function(t){t.byteLength&&(t=new Uint8Array(t)),I.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(z--,n.monitorRunDependencies&&n.monitorRunDependencies(z),0==z&&q){var t=q;q=null,t()}}()},ht=function(){c(H,ft,(function(){throw"could not load memory initializer "+H}))},pt=rt(H);if(pt)ft(pt.buffer);else if(n.memoryInitializerRequest){var dt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=rt(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+H),void ht();e=r.buffer}ft(e)};n.memoryInitializerRequest.response?setTimeout(dt,0):n.memoryInitializerRequest.addEventListener("load",dt)}else ht()}function gt(t){function e(){st||(st=!0,_||(R(k),R(B),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),F.unshift(t);var t;R(F)}()))}z>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),P.unshift(t);var t;R(P)}(),z>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function yt(t){throw n.onAbort&&n.onAbort(t),d(t+=""),g(t),_=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(q=function t(){st||gt(),st||(q=t)},n.run=gt,n.abort=yt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return gt(),t}("object"==typeof pA?pA:{}),dA="number",gA=[["sizeOfH3Index",dA],["sizeOfLatLng",dA],["sizeOfCellBoundary",dA],["sizeOfGeoLoop",dA],["sizeOfGeoPolygon",dA],["sizeOfLinkedGeoPolygon",dA],["sizeOfCoordIJ",dA],["readInt64AsDoubleFromPointer",dA],["isValidCell",dA,[dA,dA]],["latLngToCell",dA,[dA,dA,dA,dA]],["cellToLatLng",dA,[dA,dA,dA]],["cellToBoundary",dA,[dA,dA,dA]],["maxGridDiskSize",dA,[dA,dA]],["gridDisk",dA,[dA,dA,dA,dA]],["gridDiskDistances",dA,[dA,dA,dA,dA,dA]],["gridRingUnsafe",dA,[dA,dA,dA,dA]],["maxPolygonToCellsSize",dA,[dA,dA,dA,dA]],["polygonToCells",dA,[dA,dA,dA,dA]],["cellsToLinkedMultiPolygon",dA,[dA,dA,dA]],["destroyLinkedMultiPolygon",null,[dA]],["compactCells",dA,[dA,dA,dA,dA]],["uncompactCells",dA,[dA,dA,dA,dA,dA,dA]],["uncompactCellsSize",dA,[dA,dA,dA,dA,dA]],["isPentagon",dA,[dA,dA]],["isResClassIII",dA,[dA,dA]],["getBaseCellNumber",dA,[dA,dA]],["getResolution",dA,[dA,dA]],["maxFaceCount",dA,[dA,dA,dA]],["getIcosahedronFaces",dA,[dA,dA,dA]],["cellToParent",dA,[dA,dA,dA,dA]],["cellToChildren",dA,[dA,dA,dA,dA]],["cellToCenterChild",dA,[dA,dA,dA,dA]],["cellToChildrenSize",dA,[dA,dA,dA,dA]],["cellToChildPos",dA,[dA,dA,dA,dA]],["childPosToCell",dA,[dA,dA,dA,dA,dA,dA]],["areNeighborCells",dA,[dA,dA,dA,dA,dA]],["cellsToDirectedEdge",dA,[dA,dA,dA,dA,dA]],["getDirectedEdgeOrigin",dA,[dA,dA,dA]],["getDirectedEdgeDestination",dA,[dA,dA,dA]],["isValidDirectedEdge",dA,[dA,dA]],["directedEdgeToCells",dA,[dA,dA,dA]],["originToDirectedEdges",dA,[dA,dA,dA]],["directedEdgeToBoundary",dA,[dA,dA,dA]],["gridDistance",dA,[dA,dA,dA,dA,dA]],["gridPathCells",dA,[dA,dA,dA,dA,dA]],["gridPathCellsSize",dA,[dA,dA,dA,dA,dA]],["cellToLocalIj",dA,[dA,dA,dA,dA,dA,dA]],["localIjToCell",dA,[dA,dA,dA,dA,dA]],["getHexagonAreaAvgM2",dA,[dA,dA]],["getHexagonAreaAvgKm2",dA,[dA,dA]],["getHexagonEdgeLengthAvgM",dA,[dA,dA]],["getHexagonEdgeLengthAvgKm",dA,[dA,dA]],["greatCircleDistanceM",dA,[dA,dA]],["greatCircleDistanceKm",dA,[dA,dA]],["greatCircleDistanceRads",dA,[dA,dA]],["cellAreaM2",dA,[dA,dA,dA]],["cellAreaKm2",dA,[dA,dA,dA]],["cellAreaRads2",dA,[dA,dA,dA]],["edgeLengthM",dA,[dA,dA,dA]],["edgeLengthKm",dA,[dA,dA,dA]],["edgeLengthRads",dA,[dA,dA,dA]],["getNumCells",dA,[dA,dA]],["getRes0Cells",dA,[dA]],["res0CellCount",dA],["getPentagons",dA,[dA,dA]],["pentagonCount",dA],["cellToVertex",dA,[dA,dA,dA,dA]],["cellToVertexes",dA,[dA,dA,dA]],["vertexToLatLng",dA,[dA,dA,dA]],["isValidVertex",dA,[dA,dA]]],yA=4,_A={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"};_A[yA]="Resolution argument was outside of acceptable range",_A[5]="Cell argument was not valid",_A[6]="Directed edge argument was not valid",_A[7]="Undirected edge argument was not valid",_A[8]="Vertex argument was not valid",_A[9]="Pentagon distortion was encountered",_A[10]="Duplicate input",_A[11]="Cell arguments were not neighbors",_A[12]="Cell arguments had incompatible resolutions",_A[13]="Memory allocation failed",_A[14]="Bounds of provided memory were insufficient",_A[15]="Mode or flags argument was not valid";var mA=1001,vA=1002,EA={1e3:"Unknown unit"};EA[mA]="Array length out of bounds",EA[vA]="Got unexpected null value for H3 index";var wA="Unknown error";function bA(t,e,n){var r=n&&"value"in n,A=new Error((t[e]||wA)+" (code: "+e+(r?", value: "+n.value:"")+")");return A.code=e,A}function IA(t,e){return bA(_A,t,2===arguments.length?{value:e}:{})}function CA(t,e){return bA(EA,t,2===arguments.length?{value:e}:{})}function xA(t){if(0!==t)throw IA(t)}var NA={};gA.forEach((function(t){NA[t[0]]=pA.cwrap.apply(pA,t)}));var SA=16,DA=4,LA=8,TA=NA.sizeOfH3Index(),MA=NA.sizeOfLatLng(),OA=NA.sizeOfCellBoundary(),RA=NA.sizeOfGeoPolygon(),PA=NA.sizeOfGeoLoop();function kA(t){if(!t)throw CA(vA);return t}NA.sizeOfLinkedGeoPolygon(),NA.sizeOfCoordIJ();var BA=Math.pow(2,32)-1;var FA=/[^0-9a-fA-F]/;function GA(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||FA.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),SA);return[parseInt(t.substring(t.length-8),SA),e]}function UA(t){if(t>=0)return t.toString(SA);var e=QA(8,(t&=2147483647).toString(SA));return e=(parseInt(e[0],SA)+8).toString(SA)+e.substring(1)}function QA(t,e){for(var n=t-e.length,r="",A=0;A<n;A++)r+="0";return r+=e}var VA=Math.pow(2,32);function zA(t,e,n){for(var r=t.length,A=pA._calloc(r,MA),i=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)pA.HEAPF64.set([t[s/2][i],t[s/2][o]].map(KA),A/LA+s);return pA.HEAPU32.set([r,A],e/DA),e}function qA(t,e){void 0===e&&(e=0);var n=pA.getValue(t+TA*e,"i32"),r=pA.getValue(t+TA*e+DA,"i32");return r?function(t,e){return UA(e)+QA(8,UA(t))}(n,r):null}function YA(t){return 180*pA.getValue(t,"double")/Math.PI}function jA(t){return[YA(t+LA),YA(t)]}function HA(t,e){var n=pA._malloc(OA),r=GA(t),A=r[0],i=r[1];try{return xA(NA.cellToBoundary(A,i,n)),function(t){for(var e=pA.getValue(t,"i32"),n=t+LA,r=[],A=jA,i=0;i<2*e;i+=2)r.push(A(n+LA*i));return r.push(r[0]),r}(n)}finally{pA._free(n)}}function XA(t,e){var n=GA(t),r=n[0],A=n[1],i=pA._malloc(TA);try{return xA(NA.cellToParent(r,A,e,i)),kA(qA(i))}finally{pA._free(i)}}function $A(t,e,n){var r,A="number"!=typeof(r=t)?[0,0]:[0|r,r/VA|0],i=A[0],o=A[1],s=GA(e),a=s[0],u=s[1],c=pA._malloc(TA);try{return xA(NA.childPosToCell(i,o,a,u,n,c)),kA(qA(c))}finally{pA._free(c)}}function WA(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw IA(yA,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,A=function(t,e){var n,r=t.length-1,A=pA._calloc(RA),i=0+PA,o=i+DA;if(zA(t[0],A+0,e),r>0){n=pA._calloc(r,PA);for(var s=0;s<r;s++)zA(t[s+1],n+PA*s,e)}return pA.setValue(A+i,r,"i32"),pA.setValue(A+o,n,"i32"),A}("number"==typeof t[0][0]?[t]:t,n),i=pA._malloc(8);try{xA(NA.maxPolygonToCellsSize(A,e,0,i));var o=function(t){if(t>BA)throw CA(mA,t);return t}((r=i,NA.readInt64AsDoubleFromPointer(r))),s=pA._calloc(o,TA);try{return xA(NA.polygonToCells(A,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var A=qA(t,r);null!==A&&n.push(A)}return n}(s,o)}finally{pA._free(s)}}finally{pA._free(i),function(t){var e=0+PA,n=e+DA,r=DA;pA._free(pA.getValue(t+0+r,"i8*"));var A=pA.getValue(t+e,"i32");if(A>0){for(var i=pA.getValue(t+n,"i32"),o=0;o<A;o++)pA._free(pA.getValue(i+PA*o+r,"i8*"));pA._free(i)}pA._free(t)}(A)}}function KA(t){return t*Math.PI/180}const ZA=({icao:t,mapping:e})=>{if(!t)throw new sA("Missing ICAO code.");if(!e)throw new sA("Missing aircraft mapping.");const n=e.find((e=>e.icao.toUpperCase()===t.toUpperCase()))?.group;if(!n)throw new sA(`Aircraft type not found for ICAO: ${t}`);return n},JA=t=>void 0===t,ti=t=>"function"==typeof t,ei=t=>"object"==typeof t,ni=t=>{let e;const n=()=>{clearTimeout(e),e=null};return{run:r=>{n(),e=setTimeout(r,t)},cancel:n}},ri=(t,e)=>{if(JA(e))return!1;const n=ei(e),r=Array.isArray(e);return n&&!r?Object.keys(e).some((n=>ri(t?.[n],e[n]))):r?e.some(((e,n)=>ri(t?.[n],e))):t!==e},Ai=({current:t,next:e})=>{const n=new Set,r=!JA(t)&&ei(t);if(!(!JA(e)&&ei(e)))return n;const A=Object.keys(e);return r?(A.forEach((r=>{ri(t[r],e[r])&&n.add(r)})),n):(A.forEach((t=>n.add(t))),n)};var ii=Object.freeze({__proto__:null,buildDataKeyFromComponents:({components:t,separator:e="-"})=>t.join(e),debounce:(t,e)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>t(...r)),e)}},getChangedFields:Ai,getTimer:ni,isChanged:ri,isFunction:ti,isObject:ei,isUndefined:JA,mapAircraftIcaoToAircraftType:ZA,mergeByProperty:(t,e,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},parseDataKeyToComponents:({dataKey:t,separator:e="-"})=>t.split(e),throttle:(t,e)=>{let n=0;return(...r)=>{const A=(new Date).getTime();A-n<e||(n=A,t(...r))}}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var si={exports:{}};si.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",A="second",i="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),A=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(A,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()),A=e.clone().add(r,u),i=n-A<0,o=e.clone().add(r+(i?-1:1),u);return+(-(r+(n-A)/(i?A-o:o-A))||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:i,s:A,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=g;var E="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[E])},b=function t(e,n,r){var A;if(!e)return m;if("string"==typeof e){var i=e.toLowerCase();v[i]&&(A=i),n&&(v[i]=n,A=i);var o=e.split("-");if(!A&&o.length>1)return t(o[0])}else{var s=e.name;v[s]=e,A=s}return!r&&A&&(m=A),A||!r&&m},I=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)},C=_;C.l=b,C.i=w,C.w=function(t,e){return I(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=b(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[E]=!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(C.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 A=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}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 C},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(t,e){var n=I(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return I(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<I(t)},y.$g=function(t,e,n){return C.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=!!C.u(e)||e,c=C.p(t),h=function(t,e){var A=C.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?A:A.endOf(s)},p=function(t,e){return C.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 i:return p(_+"Seconds",2);case A: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=C.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[i]=c+"Minutes",n[A]=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[C.p(t)]()},y.add=function(r,c){var f,h=this;r=Number(r);var p=C.p(c),d=function(t){var e=I(h);return C.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[i]=e,f[o]=n,f[A]=t,f)[p]||1,y=this.$d.getTime()+r*g;return C.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",A=C.z(this),i=this.$H,o=this.$m,s=this.$M,a=n.weekdays,u=n.months,c=n.meridiem,l=function(t,n,A,i){return t&&(t[n]||t(e,r))||A[n].slice(0,i)},f=function(t){return C.s(i%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 C.s(e.$y,4,"0");case"M":return s+1;case"MM":return C.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 C.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(i);case"HH":return C.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(i,o,!0);case"A":return p(i,o,!1);case"m":return String(o);case"mm":return C.s(o,2,"0");case"s":return String(e.$s);case"ss":return C.s(e.$s,2,"0");case"SSS":return C.s(e.$ms,3,"0");case"Z":return A}return null}(t)||A.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,f,h){var p,d=this,g=C.p(f),y=I(r),_=(y.utcOffset()-this.utcOffset())*e,m=this-y,v=function(){return C.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 i:p=m/e;break;case A:p=m/t;break;default:p=m}return h?p:C.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=b(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return C.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}(),N=x.prototype;return I.prototype=N,[["$ms",r],["$s",A],["$m",i],["$H",o],["$W",s],["$M",u],["$y",l],["$D",f]].forEach((function(t){N[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),I.extend=function(t,e){return t.$i||(t(e,x,I),t.$i=!0),I},I.locale=b,I.isDayjs=w,I.unix=function(t){return I(1e3*t)},I.en=v[m],I.Ls=v,I.p={},I}();var ai=oi(si.exports),ui=6371008.8,ci={centimeters:100*ui,centimetres:100*ui,degrees:ui/111325,feet:3.28084*ui,inches:39.37*ui,kilometers:ui/1e3,kilometres:ui/1e3,meters:ui,metres:ui,miles:ui/1609.344,millimeters:1e3*ui,millimetres:1e3*ui,nauticalmiles:ui/1852,radians:1,yards:1.0936*ui};function li(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 fi(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(!mi(t[0])||!mi(t[1]))throw new Error("coordinates must contain numbers");return li({type:"Point",coordinates:t},e,n)}function hi(t,e,n){void 0===n&&(n={});for(var r=0,A=t;r<A.length;r++){var i=A[r];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return li({type:"Polygon",coordinates:t},e,n)}function pi(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 di(t,e){void 0===e&&(e="kilometers");var n=ci[e];if(!n)throw new Error(e+" units is invalid");return t*n}function gi(t,e){void 0===e&&(e="kilometers");var n=ci[e];if(!n)throw new Error(e+" units is invalid");return t/n}function yi(t){return t%360*Math.PI/180}function _i(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 di(gi(t,e),n)}function mi(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function vi(t,e,n){if(null!==t)for(var r,A,i,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 E=o.type;switch(l=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){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"===E&&m++}"LineString"===E&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<a.length;r++){for(A=0;A<a[r].length-l;A++){if(!1===e(a[r][A],f,y,m,v))return!1;f++}"MultiLineString"===E&&m++,"Polygon"===E&&v++}"Polygon"===E&&m++;break;case"MultiPolygon":for(r=0;r<a.length;r++){for(v=0,A=0;A<a[r].length;A++){for(i=0;i<a[r][A].length-l;i++){if(!1===e(a[r][A][i],f,y,m,v))return!1;f++}v++}m++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===vi(o.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ei(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 wi(t,e){var n,r,A,i,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,A=0;A<o;A++)if(null!==(i=a?s.geometries[A]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,f,u,c,l))return!1;break;case"GeometryCollection":for(r=0;r<i.geometries.length;r++)if(!1===e(i.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 bi(t){var e=[1/0,1/0,-1/0,-1/0];return vi(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 Ii(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 Ci(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return xi(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 xi(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Si(t);default:throw new Error("unknown GeoJSON type")}}function xi(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=Ni(t.properties),e.geometry=Si(t.geometry),e}function Ni(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]=Ni(r):e[n]=r})),e):e}function Si(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Si(t)})),e):(e.coordinates=Di(t.coordinates),e)}function Di(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Di(t)}))}function Li(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),A=Number(t[2]),i=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 hi([[o,[A,r],[A,i],[n,i],o]],e.properties,{bbox:t,id:e.id})}function Ti(t,e){void 0===e&&(e={});var n=bi(t);return fi([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}function Mi(t,e,n){void 0===n&&(n={});var r=Ii(t),A=Ii(e);A[0]+=A[0]-r[0]>180?-360:r[0]-A[0]>180?360:0;var i=function(t,e,n){var r=n=void 0===n?ui:Number(n),A=t[1]*Math.PI/180,i=e[1]*Math.PI/180,o=i-A,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var a=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(A/2+Math.PI/4)),u=Math.abs(a)>1e-11?o/a:Math.cos(A);return Math.sqrt(o*o+u*u*s*s)*r}(r,A);return _i(i,"meters",n.units)}function Oi(t,e){var n=yi(t[1]),r=yi(e[1]),A=yi(e[0]-t[0]);A>Math.PI&&(A-=2*Math.PI),A<-Math.PI&&(A+=2*Math.PI);var i=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(A,i))+360)%360}function Ri(t,e,n,r){void 0===r&&(r={});var A=e<0,i=_i(Math.abs(e),r.units,"meters");A&&(i=-Math.abs(i));var o=Ii(t),s=function(t,e,n,r){r=void 0===r?ui:Number(r);var A=e/r,i=t[0]*Math.PI/180,o=yi(t[1]),s=yi(n),a=A*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=A*Math.sin(s)/l;return[(180*(i+f)/Math.PI+540)%360-180,180*u/Math.PI]}(o,i,n);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,fi(s,r.properties)}function Pi(t,e,n){if(!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,A=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(A)||"object"==typeof A;return!0!==i&&(t=Ci(t)),"FeatureCollection"!==t.type||o?ki(t,e,A):(Ei(t,(function(n,r){t.features[r]=ki(n,e,A)})),t)}function ki(t,e,n){var r,A="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 Ii(e);var n=t.bbox?t.bbox:bi(t),r=n[0],A=n[1],i=n[2],o=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return fi([r,A]);case"se":case"southeast":case"eastsouth":case"bottomright":return fi([i,A]);case"nw":case"northwest":case"westnorth":case"topleft":return fi([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return fi([i,o]);case"center":return Ti(t);case void 0:case null:case"centroid":return function(t,e){void 0===e&&(e={});var n=0,r=0,A=0;return vi(t,(function(t){n+=t[0],r+=t[1],A++}),!0),fi([n/A,r/A],e.properties)}(t);default:throw new Error("invalid origin")}}(t,n),1===e||A||vi(t,(function(t){var r,A,i,o,s=Mi(n,t),a=(r=n,A=t,void 0===i&&(i={}),(o=i.final?Oi(Ii(A),Ii(r)):Oi(Ii(r),Ii(A)))>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")}(Ri(n,s*e,a));t[0]=u[0],t[1]=u[1],3===t.length&&(t[2]*=e)})),t}bi.default=bi,"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 A=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(A=A<0?Math.max(n+arguments[2],0):Math.min(A,n);r<A;)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 Bi=function(){};Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},Bi.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var Fi=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),Gi=function(){},Ui={MAX_VALUE:{configurable:!0}};Gi.isNaN=function(t){return Number.isNaN(t)},Gi.doubleToLongBits=function(t){return t},Gi.longBitsToDouble=function(t){return t},Gi.isInfinite=function(t){return!Number.isFinite(t)},Ui.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Gi,Ui);var Qi=function(){},Vi=function(){},zi=function(){};function qi(){}var Yi=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])},ji={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};Yi.prototype.setOrdinate=function(t,e){switch(t){case Yi.X:this.x=e;break;case Yi.Y:this.y=e;break;case Yi.Z:this.z=e;break;default:throw new Fi("Invalid ordinate index: "+t)}},Yi.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!!Bi.equalsWithTolerance(this.x,e.x,n)&&!!Bi.equalsWithTolerance(this.y,e.y,n)}},Yi.prototype.getOrdinate=function(t){switch(t){case Yi.X:return this.x;case Yi.Y:return this.y;case Yi.Z:return this.z}throw new Fi("Invalid ordinate index: "+t)},Yi.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Gi.isNaN(this.z))&&Gi.isNaN(t.z)},Yi.prototype.equals=function(t){return t instanceof Yi&&this.equals2D(t)},Yi.prototype.equalInZ=function(t,e){return Bi.equalsWithTolerance(this.z,t.z,e)},Yi.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},Yi.prototype.clone=function(){},Yi.prototype.copy=function(){return new Yi(this)},Yi.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Yi.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)},Yi.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},Yi.prototype.hashCode=function(){var t=17;return t=37*(t=37*t+Yi.hashCode(this.x))+Yi.hashCode(this.y)},Yi.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},Yi.prototype.interfaces_=function(){return[Qi,Vi,qi]},Yi.prototype.getClass=function(){return Yi},Yi.hashCode=function(){if(1===arguments.length){Gi.doubleToLongBits(arguments[0]);return Math.trunc(0)}},ji.DimensionalComparator.get=function(){return Hi},ji.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},ji.NULL_ORDINATE.get=function(){return Gi.NaN},ji.X.get=function(){return 0},ji.Y.get=function(){return 1},ji.Z.get=function(){return 2},Object.defineProperties(Yi,ji);var Hi=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 Fi("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Hi.prototype.compare=function(t,e){var n=t,r=e,A=Hi.compare(n.x,r.x);if(0!==A)return A;var i=Hi.compare(n.y,r.y);return 0!==i?i:this._dimensionsToTest<=2?0:Hi.compare(n.z,r.z)},Hi.prototype.interfaces_=function(){return[zi]},Hi.prototype.getClass=function(){return Hi},Hi.compare=function(t,e){return t<e?-1:t>e?1:Gi.isNaN(t)?Gi.isNaN(e)?0:-1:Gi.isNaN(e)?1:0};var Xi=function(){};Xi.prototype.create=function(){},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi};var $i=function(){},Wi={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},$i.toLocationSymbol=function(t){switch(t){case $i.EXTERIOR:return"e";case $i.BOUNDARY:return"b";case $i.INTERIOR:return"i";case $i.NONE:return"-"}throw new Fi("Unknown location value: "+t)},Wi.INTERIOR.get=function(){return 0},Wi.BOUNDARY.get=function(){return 1},Wi.EXTERIOR.get=function(){return 2},Wi.NONE.get=function(){return-1},Object.defineProperties($i,Wi);var Ki=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Zi=function(){},Ji={LOG_10:{configurable:!0}};Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi},Zi.log10=function(t){var e=Math.log(t);return Gi.isInfinite(e)||Gi.isNaN(e)?e:e/Zi.LOG_10},Zi.min=function(t,e,n,r){var A=t;return e<A&&(A=e),n<A&&(A=n),r<A&&(A=r),A},Zi.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],A=arguments[1],i=arguments[2];return r<A?A:r>i?i:r}},Zi.wrap=function(t,e){return t<0?e- -t%e:t%e},Zi.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],A=arguments[2],i=arguments[3],o=arguments[0];return r>o&&(o=r),A>o&&(o=A),i>o&&(o=i),o}},Zi.average=function(t,e){return(t+e)/2},Ji.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Zi,Ji);var to=function(t){this.str=t};to.prototype.append=function(t){this.str+=t},to.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},to.prototype.toString=function(t){return this.str};var eo=function(t){this.value=t};eo.prototype.intValue=function(){return this.value},eo.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},eo.isNaN=function(t){return Number.isNaN(t)};var no=function(){};no.isWhitespace=function(t){return t<=32&&t>=0||127===t},no.toUpperCase=function(t){return t.toUpperCase()};var ro=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 if("string"==typeof arguments[0]){t.call(this,t.parse(arguments[0]))}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.init(r,A)}},Ao={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}};ro.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},ro.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=ro.magnitude(n._hi),A=ro.TEN.pow(r);(n=n.divide(A)).gt(ro.TEN)?(n=n.divide(ro.TEN),r+=1):n.lt(ro.ONE)&&(n=n.multiply(ro.TEN),r-=1);for(var i=r+1,o=new to,s=ro.MAX_PRINT_DIGITS-1,a=0;a<=s;a++){t&&a===i&&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(ro.valueOf(u)).multiply(ro.TEN),c&&n.selfAdd(ro.TEN);var f=!0,h=ro.magnitude(n._hi);if(h<0&&Math.abs(h)>=s-a&&(f=!1),!f)break}return e[0]=r,o.toString()},ro.prototype.sqr=function(){return this.multiply(this)},ro.prototype.doubleValue=function(){return this._hi+this._lo},ro.prototype.subtract=function(){if(arguments[0]instanceof ro){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},ro.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},ro.prototype.isZero=function(){return 0===this._hi&&0===this._lo},ro.prototype.selfSubtract=function(){if(arguments[0]instanceof ro){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)}},ro.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},ro.prototype.min=function(t){return this.le(t)?this:t},ro.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof ro){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,r,A,i,o=arguments[0],s=arguments[1],a=null,u=null,c=null,l=null;return A=this._hi/o,l=(a=(c=ro.SPLIT*A)-(a=c-A))*(u=(l=ro.SPLIT*o)-(u=l-o))-(i=A*o)+a*(r=o-u)+(n=A-a)*u+n*r,l=A+(c=(this._hi-i-l+this._lo-A*s)/o),this._hi=l,this._lo=A-l+c,this}},ro.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},ro.prototype.divide=function(){if(arguments[0]instanceof ro){var t,e,n,r,A=arguments[0],i=null,o=null,s=null,a=null;return t=(n=this._hi/A._hi)-(i=(s=ro.SPLIT*n)-(i=s-n)),a=i*(o=(a=ro.SPLIT*A._hi)-(o=a-A._hi))-(r=n*A._hi)+i*(e=A._hi-o)+t*o+t*e,s=(this._hi-r-a+this._lo-n*A._lo)/A._hi,new ro(a=n+s,n-a+s)}if("number"==typeof arguments[0]){var u=arguments[0];return Gi.isNaN(u)?ro.createNaN():ro.copy(this).selfDivide(u,0)}},ro.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},ro.prototype.pow=function(t){if(0===t)return ro.valueOf(1);var e=new ro(this),n=ro.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},ro.prototype.ceil=function(){if(this.isNaN())return ro.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new ro(t,e)},ro.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},ro.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},ro.prototype.setValue=function(){if(arguments[0]instanceof ro){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},ro.prototype.max=function(t){return this.ge(t)?this:t},ro.prototype.sqrt=function(){if(this.isZero())return ro.valueOf(0);if(this.isNegative())return ro.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=ro.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},ro.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof ro){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,n,r,A,i,o=arguments[0],s=null;return s=(r=this._hi+o)-(A=r-this._hi),n=(i=(s=o-A+(this._hi-s))+this._lo)+(r-(e=r+i)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var a,u,c,l,f=arguments[0],h=arguments[1],p=null,d=null,g=null;c=this._hi+f,u=this._lo+h,d=c-(g=c-this._hi),p=u-(l=u-this._lo);var y=(a=c+(g=(d=f-g+(this._hi-d))+u))+(g=(p=h-l+(this._lo-p))+(g+(c-a))),_=g+(a-y);return this._hi=y,this._lo=_,this}},ro.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof ro){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,r,A=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null;o=(a=ro.SPLIT*this._hi)-this._hi,u=ro.SPLIT*A,o=a-o,n=this._hi-o,s=u-A;var c=(a=this._hi*A)+(u=o*(s=u-s)-a+o*(r=A-s)+n*s+n*r+(this._hi*i+this._lo*A)),l=u+(o=a-c);return this._hi=c,this._lo=l,this}},ro.prototype.selfSqr=function(){return this.selfMultiply(this)},ro.prototype.floor=function(){if(this.isNaN())return ro.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new ro(t,e)},ro.prototype.negate=function(){return this.isNaN()?this:new ro(-this._hi,-this._lo)},ro.prototype.clone=function(){},ro.prototype.multiply=function(){if(arguments[0]instanceof ro){var t=arguments[0];return t.isNaN()?ro.createNaN():ro.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Gi.isNaN(e)?ro.createNaN():ro.copy(this).selfMultiply(e,0)}},ro.prototype.isNaN=function(){return Gi.isNaN(this._hi)},ro.prototype.intValue=function(){return Math.trunc(this._hi)},ro.prototype.toString=function(){var t=ro.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},ro.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,A=n;if("."===n.charAt(0))A="0"+n;else if(r<0)A="0."+ro.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var i=r-n.length;A=n+ro.stringOfChar("0",i)+".0"}return this.isNegative()?"-"+A:A},ro.prototype.reciprocal=function(){var t,e,n,r,A=null,i=null,o=null,s=null;t=(n=1/this._hi)-(A=(o=ro.SPLIT*n)-(A=o-n)),i=(s=ro.SPLIT*this._hi)-this._hi;var a=n+(o=(1-(r=n*this._hi)-(s=A*(i=s-i)-r+A*(e=this._hi-i)+t*i+t*e)-n*this._lo)/this._hi);return new ro(a,n-a+o)},ro.prototype.toSciNotation=function(){if(this.isZero())return ro.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=ro.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var A="";n.length>1&&(A=n.substring(1));var i=n.charAt(0)+"."+A;return this.isNegative()?"-"+i+r:i+r},ro.prototype.abs=function(){return this.isNaN()?ro.NaN:this.isNegative()?this.negate():new ro(this)},ro.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},ro.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},ro.prototype.add=function(){if(arguments[0]instanceof ro){var t=arguments[0];return ro.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return ro.copy(this).selfAdd(e)}},ro.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 ro){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}},ro.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},ro.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},ro.prototype.trunc=function(){return this.isNaN()?ro.NaN:this.isPositive()?this.floor():this.ceil()},ro.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},ro.prototype.interfaces_=function(){return[qi,Qi,Vi]},ro.prototype.getClass=function(){return ro},ro.sqr=function(t){return ro.valueOf(t).selfMultiply(t)},ro.valueOf=function(){return"string"==typeof arguments[0]?ro.parse(arguments[0]):"number"==typeof arguments[0]?new ro(arguments[0]):void 0},ro.sqrt=function(t){return ro.valueOf(t).sqrt()},ro.parse=function(t){for(var e=0,n=t.length;no.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var A=t.charAt(e);"-"!==A&&"+"!==A||(e++,"-"===A&&(r=!0))}for(var i=new ro,o=0,s=0,a=0;!(e>=n);){var u=t.charAt(e);if(e++,no.isDigit(u)){var c=u-"0";i.selfMultiply(ro.TEN),i.selfAdd(c),o++}else{if("."!==u){if("e"===u||"E"===u){var l=t.substring(e);try{a=eo.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=i,h=o-s-a;if(0===h)f=i;else if(h>0){var p=ro.TEN.pow(h);f=i.divide(p)}else if(h<0){var d=ro.TEN.pow(-h);f=i.multiply(d)}return r?f.negate():f},ro.createNaN=function(){return new ro(Gi.NaN,Gi.NaN)},ro.copy=function(t){return new ro(t)},ro.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},ro.stringOfChar=function(t,e){for(var n=new to,r=0;r<e;r++)n.append(t);return n.toString()},Ao.PI.get=function(){return new ro(3.141592653589793,12246467991473532e-32)},Ao.TWO_PI.get=function(){return new ro(6.283185307179586,24492935982947064e-32)},Ao.PI_2.get=function(){return new ro(1.5707963267948966,6123233995736766e-32)},Ao.E.get=function(){return new ro(2.718281828459045,14456468917292502e-32)},Ao.NaN.get=function(){return new ro(Gi.NaN,Gi.NaN)},Ao.EPS.get=function(){return 123259516440783e-46},Ao.SPLIT.get=function(){return 134217729},Ao.MAX_PRINT_DIGITS.get=function(){return 32},Ao.TEN.get=function(){return ro.valueOf(10)},Ao.ONE.get=function(){return ro.valueOf(1)},Ao.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ao.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(ro,Ao);var io=function(){},oo={DP_SAFE_EPSILON:{configurable:!0}};io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io},io.orientationIndex=function(t,e,n){var r=io.orientationIndexFilter(t,e,n);if(r<=1)return r;var A=ro.valueOf(e.x).selfAdd(-t.x),i=ro.valueOf(e.y).selfAdd(-t.y),o=ro.valueOf(n.x).selfAdd(-e.x),s=ro.valueOf(n.y).selfAdd(-e.y);return A.selfMultiply(s).selfSubtract(i.selfMultiply(o)).signum()},io.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},io.intersection=function(t,e,n,r){var A=ro.valueOf(r.y).selfSubtract(n.y).selfMultiply(ro.valueOf(e.x).selfSubtract(t.x)),i=ro.valueOf(r.x).selfSubtract(n.x).selfMultiply(ro.valueOf(e.y).selfSubtract(t.y)),o=A.subtract(i),s=ro.valueOf(r.x).selfSubtract(n.x).selfMultiply(ro.valueOf(t.y).selfSubtract(n.y)),a=ro.valueOf(r.y).selfSubtract(n.y).selfMultiply(ro.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(a).selfDivide(o).doubleValue(),c=ro.valueOf(t.x).selfAdd(ro.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),l=ro.valueOf(e.x).selfSubtract(t.x).selfMultiply(ro.valueOf(t.y).selfSubtract(n.y)),f=ro.valueOf(e.y).selfSubtract(t.y).selfMultiply(ro.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(f).selfDivide(o).doubleValue(),p=ro.valueOf(n.y).selfAdd(ro.valueOf(r.y).selfSubtract(n.y).selfMultiply(h)).doubleValue();return new Yi(c,p)},io.orientationIndexFilter=function(t,e,n){var r=null,A=(t.x-n.x)*(e.y-n.y),i=(t.y-n.y)*(e.x-n.x),o=A-i;if(A>0){if(i<=0)return io.signum(o);r=A+i}else{if(!(A<0))return io.signum(o);if(i>=0)return io.signum(o);r=-A-i}var s=io.DP_SAFE_EPSILON*r;return o>=s||-o>=s?io.signum(o):2},io.signum=function(t){return t>0?1:t<0?-1:0},oo.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(io,oo);var so=function(){},ao={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ao.X.get=function(){return 0},ao.Y.get=function(){return 1},ao.Z.get=function(){return 2},ao.M.get=function(){return 3},so.prototype.setOrdinate=function(t,e,n){},so.prototype.size=function(){},so.prototype.getOrdinate=function(t,e){},so.prototype.getCoordinate=function(){},so.prototype.getCoordinateCopy=function(t){},so.prototype.getDimension=function(){},so.prototype.getX=function(t){},so.prototype.clone=function(){},so.prototype.expandEnvelope=function(t){},so.prototype.copy=function(){},so.prototype.getY=function(t){},so.prototype.toCoordinateArray=function(){},so.prototype.interfaces_=function(){return[Vi]},so.prototype.getClass=function(){return so},Object.defineProperties(so,ao);var uo=function(){},co=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}(uo),lo=function(){};lo.arraycopy=function(t,e,n,r,A){for(var i=0,o=e;o<e+A;o++)n[r+i]=t[o],i++},lo.getProperty=function(t){return{"line.separator":"\n"}[t]};var fo=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 A=arguments[0],i=arguments[1];this.x=A.y*i.w-i.y*A.w,this.y=i.x*A.w-A.x*i.w,this.w=A.x*i.y-i.x*A.y}else if(arguments[0]instanceof Yi&&arguments[1]instanceof Yi){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}};fo.prototype.getY=function(){var t=this.y/this.w;if(Gi.isNaN(t)||Gi.isInfinite(t))throw new co;return t},fo.prototype.getX=function(){var t=this.x/this.w;if(Gi.isNaN(t)||Gi.isInfinite(t))throw new co;return t},fo.prototype.getCoordinate=function(){var t=new Yi;return t.x=this.getX(),t.y=this.getY(),t},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo},fo.intersection=function(t,e,n,r){var A=t.y-e.y,i=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=A*a-s*i,l=(i*u-a*o)/c,f=(s*o-A*u)/c;if(Gi.isNaN(l)||Gi.isInfinite(l)||Gi.isNaN(f)||Gi.isInfinite(f))throw new co;return new Yi(l,f)};var ho=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 Yi){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],A=arguments[1];this.init(r.x,A.x,r.y,A.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(i,o,s,a)}},po={serialVersionUID:{configurable:!0}};ho.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ho.prototype.equals=function(t){if(!(t instanceof ho))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()},ho.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ho;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,A=this._maxy<t._maxy?this._maxy:t._maxy;return new ho(e,r,n,A)},ho.prototype.isNull=function(){return this._maxx<this._minx},ho.prototype.getMaxX=function(){return this._maxx},ho.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof Yi){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof ho){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)}},ho.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof ho){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 Yi){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)}},ho.prototype.getMinY=function(){return this._miny},ho.prototype.getMinX=function(){return this._minx},ho.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof Yi){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ho){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))}},ho.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ho.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ho.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},ho.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ho.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ho.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ho.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ho.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ho.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()}},ho.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof ho){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Yi){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)}},ho.prototype.centre=function(){return this.isNull()?null:new Yi((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ho.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof Yi){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ho){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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];A<i?(this._minx=A,this._maxx=i):(this._minx=i,this._maxx=A),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},ho.prototype.getMaxY=function(){return this._maxy},ho.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)},ho.prototype.hashCode=function(){var t=17;return t=37*(t=37*(t=37*(t=37*t+Yi.hashCode(this._minx))+Yi.hashCode(this._maxx))+Yi.hashCode(this._miny))+Yi.hashCode(this._maxy)},ho.prototype.interfaces_=function(){return[Qi,qi]},ho.prototype.getClass=function(){return ho},ho.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],A=arguments[1],i=arguments[2],o=arguments[3],s=Math.min(i.x,o.x),a=Math.max(i.x,o.x),u=Math.min(r.x,A.x),c=Math.max(r.x,A.x);return!(u>a)&&(!(c<s)&&(s=Math.min(i.y,o.y),a=Math.max(i.y,o.y),u=Math.min(r.y,A.y),c=Math.max(r.y,A.y),!(u>a)&&!(c<s)))}},po.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(ho,po);var go={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*$/},yo=function(t){this.geometryFactory=t||new na};yo.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var A=go.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((A=go.emptyTypeStr.exec(t))[2]=void 0),A&&(n=A[1].toLowerCase(),r=A[2],mo[n]&&(e=mo[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},yo.prototype.write=function(t){return this.extractGeometry(t)},yo.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!_o[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+_o[e].apply(this,[t])+")"};var _o={coordinate:function(t){return t.x+" "+t.y},point:function(t){return _o.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+_o.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(_o.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(_o.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("("+_o.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+_o.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+_o.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("("+_o.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(",")}},mo={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(go.spaces);return this.geometryFactory.createPoint(new Yi(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiPoint();for(var n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(go.trimParens,"$1"),r.push(mo.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=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(go.spaces),r.push(new Yi(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=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(go.spaces),r.push(new Yi(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiLineString();for(var n=t.trim().split(go.parenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(go.trimParens,"$1"),r.push(mo.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){var e,n,r;if(void 0===t)return this.geometryFactory.createPolygon();for(var A,i=t.trim().split(go.parenComma),o=[],s=0,a=i.length;s<a;++s)e=i[s].replace(go.trimParens,"$1"),n=mo.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?A=r:o.push(r);return this.geometryFactory.createPolygon(A,o)},multipolygon:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var n=t.trim().split(go.doubleParenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(go.trimParens,"$1"),r.push(mo.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,A=e.length;r<A;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},vo=function(t){this.parser=new yo(t)};vo.prototype.write=function(t){return this.parser.write(t)},vo.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Eo=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),wo=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}(Eo),bo=function(){};bo.prototype.interfaces_=function(){return[]},bo.prototype.getClass=function(){return bo},bo.shouldNeverReachHere=function(){if(0===arguments.length)bo.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new wo("Should never reach here"+(null!==t?": "+t:""))}},bo.isTrue=function(){var t;if(1===arguments.length)bo.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new wo:new wo(t)},bo.equals=function(){var t,e,n;if(2===arguments.length)bo.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new wo("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var Io=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 Yi,this._intPt[1]=new Yi,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Co={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Io.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},Io.prototype.getTopologySummary=function(){var t=new to;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},Io.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)},Io.prototype.getIntersectionNum=function(){return this._result},Io.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)}},Io.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Io.prototype.setPrecisionModel=function(t){this._precisionModel=t},Io.prototype.isInteriorIntersection=function(){var t=this;if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],n=0;n<this._result;n++)if(!t._intPt[n].equals2D(t._inputLines[e][0])&&!t._intPt[n].equals2D(t._inputLines[e][1]))return!0;return!1}},Io.prototype.getIntersection=function(t){return this._intPt[t]},Io.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Io.prototype.hasIntersection=function(){return this._result!==Io.NO_INTERSECTION},Io.prototype.getEdgeDistance=function(t,e){return Io.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},Io.prototype.isCollinear=function(){return this._result===Io.COLLINEAR_INTERSECTION},Io.prototype.toString=function(){return vo.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+vo.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Io.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},Io.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},Io.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io},Io.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),A=Math.abs(n.y-e.y),i=-1;if(t.equals(e))i=0;else if(t.equals(n))i=r>A?r:A;else{var o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(i=r>A?o:s)||t.equals(e)||(i=Math.max(o,s))}return bo.isTrue(!(0===i&&!t.equals(e)),"Bad distance calculation"),i},Io.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,A=t.y-e.y,i=Math.sqrt(r*r+A*A);return bo.isTrue(!(0===i&&!t.equals(e)),"Invalid distance calculation"),i},Co.DONT_INTERSECT.get=function(){return 0},Co.DO_INTERSECT.get=function(){return 1},Co.COLLINEAR.get=function(){return 2},Co.NO_INTERSECTION.get=function(){return 0},Co.POINT_INTERSECTION.get=function(){return 1},Co.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Io,Co);var xo=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 ho(this._inputLines[0][0],this._inputLines[0][1]),n=new ho(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,ho.intersects(n,r,e)&&0===Do.orientationIndex(n,r,e)&&0===Do.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,A){A.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),A.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,A){var i=null;try{i=fo.intersection(t,n,r,A)}catch(o){if(!(o instanceof co))throw o;i=e.nearestEndpoint(t,n,r,A)}return i},e.prototype.intersection=function(t,n,r,A){var i=this.intersectionWithNormalization(t,n,r,A);return this.isInSegmentEnvelopes(i)||(i=new Yi(e.nearestEndpoint(t,n,r,A))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i},e.prototype.smallestInAbsValue=function(t,e,n,r){var A=t,i=Math.abs(A);return Math.abs(e)<i&&(A=e,i=Math.abs(e)),Math.abs(n)<i&&(A=n,i=Math.abs(n)),Math.abs(r)<i&&(A=r),A},e.prototype.checkDD=function(t,e,n,r,A){var i=io.intersection(t,e,n,r),o=this.isInSegmentEnvelopes(i);lo.out.println("DD in env = "+o+" --------------------- "+i),A.distance(i)>1e-4&&lo.out.println("Distance = "+A.distance(i))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var A=new Yi(t),i=new Yi(e),o=new Yi(n),s=new Yi(r),a=new Yi;this.normalizeToEnvCentre(A,i,o,s,a);var u=this.safeHCoordinateIntersection(A,i,o,s);return u.x+=a.x,u.y+=a.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,A){var i=ho.intersects(e,n,r),o=ho.intersects(e,n,A),s=ho.intersects(r,A,e),a=ho.intersects(r,A,n);return i&&o?(this._intPt[0]=r,this._intPt[1]=A,t.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):i&&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]=A,this._intPt[1]=e,!A.equals(e)||i||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&a?(this._intPt[0]=A,this._intPt[1]=n,!A.equals(n)||i||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,A){var i=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=((i>u?i:u)+(s<l?s:l))/2,p=((o>c?o:c)+(a<f?a:f))/2;A.x=h,A.y=p,t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.computeIntersect=function(e,n,r,A){if(this._isProper=!1,!ho.intersects(e,n,r,A))return t.NO_INTERSECTION;var i=Do.orientationIndex(e,n,r),o=Do.orientationIndex(e,n,A);if(i>0&&o>0||i<0&&o<0)return t.NO_INTERSECTION;var s=Do.orientationIndex(r,A,e),a=Do.orientationIndex(r,A,n);return s>0&&a>0||s<0&&a<0?t.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(e,n,r,A):(0===i||0===o||0===s||0===a?(this._isProper=!1,e.equals2D(r)||e.equals2D(A)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(A)?this._intPt[0]=n:0===i?this._intPt[0]=new Yi(r):0===o?this._intPt[0]=new Yi(A):0===s?this._intPt[0]=new Yi(e):0===a&&(this._intPt[0]=new Yi(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,A)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var A=t,i=Do.distancePointLine(t,n,r),o=Do.distancePointLine(e,n,r);return o<i&&(i=o,A=e),(o=Do.distancePointLine(n,t,e))<i&&(i=o,A=n),(o=Do.distancePointLine(r,t,e))<i&&(i=o,A=r),A},e}(Io),No=function(){};No.prototype.interfaces_=function(){return[]},No.prototype.getClass=function(){return No},No.orientationIndex=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=n.x-e.x,o=n.y-e.y;return No.signOfDet2x2(r,A,i,o)},No.signOfDet2x2=function(t,e,n,r){var A=null,i=null,o=null;if(A=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-A:A:n>0?A:-A;if(0===e||0===n)return r>0?t>0?A:-A:t>0?-A:A;if(e>0?r>0?e<=r||(A=-A,i=t,t=n,n=i,i=e,e=r,r=i):e<=-r?(A=-A,n=-n,r=-r):(i=t,t=-n,n=i,i=e,e=-r,r=i):r>0?-e<=r?(A=-A,t=-t,e=-e):(i=-t,t=n,n=i,i=-e,e=r,r=i):e>=r?(t=-t,e=-e,n=-n,r=-r):(A=-A,i=-t,t=-n,n=i,i=-e,e=-r,r=i),t>0){if(!(n>0))return A;if(!(t<=n))return A}else{if(n>0)return-A;if(!(t>=n))return-A;A=-A,t=-t,n=-n}for(;;){if((r-=(o=Math.floor(n/t))*e)<0)return-A;if(r>e)return A;if(t>(n-=o*t)+n){if(e<r+r)return A}else{if(e>r+r)return-A;n=t-n,r=e-r,A=-A}if(0===r)return 0===n?0:-A;if(0===n)return A;if((e-=(o=Math.floor(t/n))*r)<0)return A;if(e>r)return-A;if(n>(t-=o*n)+t){if(r<e+e)return-A}else{if(r>e+e)return A;t=n-t,e=r-e,A=-A}if(0===e)return 0===t?0:A;if(0===t)return-A}};var So=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};So.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 A=t.x-this._p.x,i=t.y-this._p.y,o=e.x-this._p.x,s=e.y-this._p.y,a=No.signOfDet2x2(A,i,o,s);if(0===a)return this._isPointOnSegment=!0,null;s<i&&(a=-a),a>0&&this._crossingCount++}},So.prototype.isPointInPolygon=function(){return this.getLocation()!==$i.EXTERIOR},So.prototype.getLocation=function(){return this._isPointOnSegment?$i.BOUNDARY:this._crossingCount%2==1?$i.INTERIOR:$i.EXTERIOR},So.prototype.isOnSegment=function(){return this._isPointOnSegment},So.prototype.interfaces_=function(){return[]},So.prototype.getClass=function(){return So},So.locatePointInRing=function(){if(arguments[0]instanceof Yi&&Ki(arguments[1],so)){for(var t=arguments[1],e=new So(arguments[0]),n=new Yi,r=new Yi,A=1;A<t.size();A++)if(t.getCoordinate(A,n),t.getCoordinate(A-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof Yi&&arguments[1]instanceof Array){for(var i=arguments[1],o=new So(arguments[0]),s=1;s<i.length;s++){var a=i[s],u=i[s-1];if(o.countSegment(a,u),o.isOnSegment())return o.getLocation()}return o.getLocation()}};var Do=function(){},Lo={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Do.prototype.interfaces_=function(){return[]},Do.prototype.getClass=function(){return Do},Do.orientationIndex=function(t,e,n){return io.orientationIndex(t,e,n)},Do.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 A=t[r].x-n,i=t[r+1].y;e+=A*(t[r-1].y-i)}return e/2}if(Ki(arguments[0],so)){var o=arguments[0],s=o.size();if(s<3)return 0;var a=new Yi,u=new Yi,c=new Yi;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}},Do.distanceLineLine=function(t,e,n,r){if(t.equals(e))return Do.distancePointLine(t,n,r);if(n.equals(r))return Do.distancePointLine(r,t,e);var A=!1;if(ho.intersects(t,e,n,r)){var i=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===i)A=!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))/i,a=o/i;(a<0||a>1||s<0||s>1)&&(A=!0)}}else A=!0;return A?Zi.min(Do.distancePointLine(t,n,r),Do.distancePointLine(e,n,r),Do.distancePointLine(n,t,e),Do.distancePointLine(r,t,e)):0},Do.isPointInRing=function(t,e){return Do.locatePointInRing(t,e)!==$i.EXTERIOR},Do.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new Yi;t.getCoordinate(0,r);for(var A=r.x,i=r.y,o=1;o<e;o++){t.getCoordinate(o,r);var s=r.x,a=r.y,u=s-A,c=a-i;n+=Math.sqrt(u*u+c*c),A=s,i=a}return n},Do.isCCW=function(t){var e=t.length-1;if(e<3)throw new Fi("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,A=1;A<=e;A++){var i=t[A];i.y>n.y&&(n=i,r=A)}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=Do.computeOrientation(a,n,u),l=!1;return l=0===c?a.x>u.x:c>0,l},Do.locatePointInRing=function(t,e){return So.locatePointInRing(t,e)},Do.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),A=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(A)*Math.sqrt(r)},Do.computeOrientation=function(t,e,n){return Do.orientationIndex(t,e,n)},Do.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new Fi("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var A=Do.distancePointLine(t,e[r],e[r+1]);A<n&&(n=A)}return n}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return i.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((i.x-o.x)*(s.x-o.x)+(i.y-o.y)*(s.y-o.y))/a;if(u<=0)return i.distance(o);if(u>=1)return i.distance(s);var c=((o.y-i.y)*(s.x-o.x)-(o.x-i.x)*(s.y-o.y))/a;return Math.abs(c)*Math.sqrt(a)}},Do.isOnLine=function(t,e){for(var n=new xo,r=1;r<e.length;r++){var A=e[r-1],i=e[r];if(n.computeIntersection(t,A,i),n.hasIntersection())return!0}return!1},Lo.CLOCKWISE.get=function(){return-1},Lo.RIGHT.get=function(){return Do.CLOCKWISE},Lo.COUNTERCLOCKWISE.get=function(){return 1},Lo.LEFT.get=function(){return Do.COUNTERCLOCKWISE},Lo.COLLINEAR.get=function(){return 0},Lo.STRAIGHT.get=function(){return Do.COLLINEAR},Object.defineProperties(Do,Lo);var To=function(){};To.prototype.filter=function(t){},To.prototype.interfaces_=function(){return[]},To.prototype.getClass=function(){return To};var Mo=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Oo={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}};Mo.prototype.isGeometryCollection=function(){return this.getSortIndex()===Mo.SORTINDEX_GEOMETRYCOLLECTION},Mo.prototype.getFactory=function(){return this._factory},Mo.prototype.getGeometryN=function(t){return this},Mo.prototype.getArea=function(){return 0},Mo.prototype.isRectangle=function(){return!1},Mo.prototype.equals=function(){if(arguments[0]instanceof Mo){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof Mo))return!1;var n=e;return this.equalsExact(n)}},Mo.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},Mo.prototype.geometryChanged=function(){this.apply(Mo.geometryChangedFilter)},Mo.prototype.geometryChangedAction=function(){this._envelope=null},Mo.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},Mo.prototype.getLength=function(){return 0},Mo.prototype.getNumGeometries=function(){return 1},Mo.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)}},Mo.prototype.getUserData=function(){return this._userData},Mo.prototype.getSRID=function(){return this._SRID},Mo.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Mo.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===Mo.SORTINDEX_GEOMETRYCOLLECTION)throw new Fi("This method does not support GeometryCollection arguments")},Mo.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},Mo.prototype.norm=function(){var t=this.copy();return t.normalize(),t},Mo.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Mo.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new ho(this._envelope)},Mo.prototype.setSRID=function(t){this._SRID=t},Mo.prototype.setUserData=function(t){this._userData=t},Mo.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var A=n.next(),i=r.next(),o=A.compareTo(i);if(0!==o)return o}return n.hasNext()?1:r.hasNext()?-1:0},Mo.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Mo.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Mo.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Mo.SORTINDEX_MULTIPOINT||this.getSortIndex()===Mo.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Mo.SORTINDEX_MULTIPOLYGON},Mo.prototype.interfaces_=function(){return[Vi,Qi,qi]},Mo.prototype.getClass=function(){return Mo},Mo.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},Mo.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},Oo.serialVersionUID.get=function(){return 0x799ea46522854c00},Oo.SORTINDEX_POINT.get=function(){return 0},Oo.SORTINDEX_MULTIPOINT.get=function(){return 1},Oo.SORTINDEX_LINESTRING.get=function(){return 2},Oo.SORTINDEX_LINEARRING.get=function(){return 3},Oo.SORTINDEX_MULTILINESTRING.get=function(){return 4},Oo.SORTINDEX_POLYGON.get=function(){return 5},Oo.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Oo.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Oo.geometryChangedFilter.get=function(){return Ro},Object.defineProperties(Mo,Oo);var Ro=function(){};Ro.interfaces_=function(){return[To]},Ro.filter=function(t){t.geometryChangedAction()};var Po=function(){};Po.prototype.filter=function(t){},Po.prototype.interfaces_=function(){return[]},Po.prototype.getClass=function(){return Po};var ko=function(){},Bo={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}};ko.prototype.isInBoundary=function(t){},ko.prototype.interfaces_=function(){return[]},ko.prototype.getClass=function(){return ko},Bo.Mod2BoundaryNodeRule.get=function(){return Fo},Bo.EndPointBoundaryNodeRule.get=function(){return Go},Bo.MultiValentEndPointBoundaryNodeRule.get=function(){return Uo},Bo.MonoValentEndPointBoundaryNodeRule.get=function(){return Qo},Bo.MOD2_BOUNDARY_RULE.get=function(){return new Fo},Bo.ENDPOINT_BOUNDARY_RULE.get=function(){return new Go},Bo.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Uo},Bo.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Qo},Bo.OGC_SFS_BOUNDARY_RULE.get=function(){return ko.MOD2_BOUNDARY_RULE},Object.defineProperties(ko,Bo);var Fo=function(){};Fo.prototype.isInBoundary=function(t){return t%2==1},Fo.prototype.interfaces_=function(){return[ko]},Fo.prototype.getClass=function(){return Fo};var Go=function(){};Go.prototype.isInBoundary=function(t){return t>0},Go.prototype.interfaces_=function(){return[ko]},Go.prototype.getClass=function(){return Go};var Uo=function(){};Uo.prototype.isInBoundary=function(t){return t>1},Uo.prototype.interfaces_=function(){return[ko]},Uo.prototype.getClass=function(){return Uo};var Qo=function(){};Qo.prototype.isInBoundary=function(t){return 1===t},Qo.prototype.interfaces_=function(){return[ko]},Qo.prototype.getClass=function(){return Qo};var Vo=function(){};function zo(t){this.message=t||""}Vo.prototype.add=function(){},Vo.prototype.addAll=function(){},Vo.prototype.isEmpty=function(){},Vo.prototype.iterator=function(){},Vo.prototype.size=function(){},Vo.prototype.toArray=function(){},Vo.prototype.remove=function(){},zo.prototype=new Error,zo.prototype.name="IndexOutOfBoundsException";var qo=function(){};qo.prototype.hasNext=function(){},qo.prototype.next=function(){},qo.prototype.remove=function(){};var Yo=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}(Vo);function jo(t){this.message=t||""}jo.prototype=new Error,jo.prototype.name="NoSuchElementException";var Ho=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Vo&&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,Vo]},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 Xo(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new zo;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}(Yo),Xo=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 jo;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}(qo),$o=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),e.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(){var e=this;if(1===arguments.length){var n=arguments[0];t.prototype.add.call(this,n)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var r=arguments[0],A=arguments[1];return this.add(r,A,!0),!0}if(arguments[0]instanceof Yi&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1])if(this.size()>=1)if(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 o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c<a.length;c++)e.add(a[c],u);else for(var l=a.length-1;l>=0;l--)e.add(a[l],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof Yi){var f=arguments[0],h=arguments[1];if(!arguments[2]){var p=this.size();if(p>0){if(f>0)if(this.get(f-1).equals2D(h))return null;if(f<p)if(this.get(f).equals2D(h))return null}}t.prototype.add.call(this,f,h)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)e.add(d[v],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new Yi(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Ho),Wo=function(){},Ko={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ko.ForwardComparator.get=function(){return Zo},Ko.BidirectionalComparator.get=function(){return Jo},Ko.coordArrayType.get=function(){return new Array(0).fill(null)},Wo.prototype.interfaces_=function(){return[]},Wo.prototype.getClass=function(){return Wo},Wo.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Wo.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Wo.indexOf(r,e)<0)return r}return null},Wo.scroll=function(t,e){var n=Wo.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);lo.arraycopy(t,n,r,0,t.length-n),lo.arraycopy(t,0,r,t.length-n,n),lo.arraycopy(r,0,t,0,t.length)},Wo.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],A=arguments[1],i=arguments[2];if(r===A)return!0;if(null===r||null===A)return!1;if(r.length!==A.length)return!1;for(var o=0;o<r.length;o++)if(0!==i.compare(r[o],A[o]))return!1;return!0}},Wo.intersection=function(t,e){for(var n=new $o,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Wo.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Wo.removeRepeatedPoints=function(t){return Wo.hasRepeatedPoints(t)?new $o(t,!1).toCoordinateArray():t},Wo.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var A=t[r];t[r]=t[e-r],t[e-r]=A}},Wo.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 A=0,i=0;i<t.length;i++)null!==t[i]&&(r[A++]=t[i]);return r},Wo.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 Yi(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],A=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=0;a<s;a++)i[o+a]=new Yi(r[A+a])},Wo.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],A=e[t.length-n-1];if(0!==r.compareTo(A))return!1}return!0},Wo.envelope=function(t){for(var e=new ho,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Wo.toCoordinateArray=function(t){return t.toArray(Wo.coordArrayType)},Wo.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Wo.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Wo.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},Wo.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},Wo.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},Wo.extract=function(t,e,n){e=Zi.clamp(e,0,t.length);var r=(n=Zi.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var A=new Array(r).fill(null);if(0===r)return A;for(var i=0,o=e;o<=n;o++)A[i++]=t[o];return A},Object.defineProperties(Wo,Ko);var Zo=function(){};Zo.prototype.compare=function(t,e){return Wo.compare(t,e)},Zo.prototype.interfaces_=function(){return[zi]},Zo.prototype.getClass=function(){return Zo};var Jo=function(){};Jo.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 A=Wo.compare(n,r);return Wo.isEqualReversed(n,r)?0:A},Jo.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 A=Wo.increasingDirection(n),i=Wo.increasingDirection(r),o=A>0?0:n.length-1,s=i>0?0:n.length-1,a=0;a<n.length;a++){var u=n[o].compareTo(r[s]);if(0!==u)return u;o+=A,s+=i}return 0},Jo.prototype.interfaces_=function(){return[zi]},Jo.prototype.getClass=function(){return Jo};var ts=function(){};ts.prototype.get=function(){},ts.prototype.put=function(){},ts.prototype.size=function(){},ts.prototype.values=function(){},ts.prototype.entrySet=function(){};var es=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}(ts);function ns(t){this.message=t||""}function rs(){}ns.prototype=new Error,ns.prototype.name="OperationNotSupported",rs.prototype=new Vo,rs.prototype.contains=function(){};var As=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Vo&&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 is(this)},e}(rs),is=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 jo;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new ns},e}(qo);function os(t){return null===t?0:t.color}function ss(t){return null===t?null:t.parent}function as(t,e){null!==t&&(t.color=e)}function us(t){return null===t?null:t.left}function cs(t){return null===t?null:t.right}function ls(){this.root_=null,this.size_=0}ls.prototype=new es,ls.prototype.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},ls.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,A=this.root_;do{if(n=A,(r=t.compareTo(A.key))<0)A=A.left;else{if(!(r>0)){var i=A.value;return A.value=e,i}A=A.right}}while(null!==A);var o={key:t,left:null,right:null,value:e,parent:n,color:0,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},ls.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(ss(t)===us(ss(ss(t)))){var n=cs(ss(ss(t)));1===os(n)?(as(ss(t),0),as(n,0),as(ss(ss(t)),1),t=ss(ss(t))):(t===cs(ss(t))&&(t=ss(t),e.rotateLeft(t)),as(ss(t),0),as(ss(ss(t)),1),e.rotateRight(ss(ss(t))))}else{var r=us(ss(ss(t)));1===os(r)?(as(ss(t),0),as(r,0),as(ss(ss(t)),1),t=ss(ss(t))):(t===us(ss(t))&&(t=ss(t),e.rotateRight(t)),as(ss(t),0),as(ss(ss(t)),1),e.rotateLeft(ss(ss(t))))}this.root_.color=0},ls.prototype.values=function(){var t=new Ho,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=ls.successor(e));)t.add(e.value);return t},ls.prototype.entrySet=function(){var t=new As,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=ls.successor(e));)t.add(e);return t},ls.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}},ls.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}},ls.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},ls.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},ls.prototype.size=function(){return this.size_};var fs=function(){};function hs(){}function ps(){this.array_=[],arguments[0]instanceof Vo&&this.addAll(arguments[0])}fs.prototype.interfaces_=function(){return[]},fs.prototype.getClass=function(){return fs},hs.prototype=new rs,ps.prototype=new hs,ps.prototype.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},ps.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},ps.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},ps.prototype.remove=function(t){throw new ns},ps.prototype.size=function(){return this.array_.length},ps.prototype.isEmpty=function(){return 0===this.array_.length},ps.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},ps.prototype.iterator=function(){return new ds(this)};var ds=function(t){this.treeSet_=t,this.position_=0};ds.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new jo;return this.treeSet_.array_[this.position_++]},ds.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ds.prototype.remove=function(){throw new ns};var gs=function(){};gs.sort=function(){var t,e,n,r,A=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},A.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},A.sort(r);else if(3===arguments.length){(e=A.slice(arguments[1],arguments[2])).sort();var i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length));for(A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])}else if(4===arguments.length)for(e=A.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length)),A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])},gs.asList=function(t){for(var e=new Ho,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var ys=function(){},_s={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}};_s.P.get=function(){return 0},_s.L.get=function(){return 1},_s.A.get=function(){return 2},_s.FALSE.get=function(){return-1},_s.TRUE.get=function(){return-2},_s.DONTCARE.get=function(){return-3},_s.SYM_FALSE.get=function(){return"F"},_s.SYM_TRUE.get=function(){return"T"},_s.SYM_DONTCARE.get=function(){return"*"},_s.SYM_P.get=function(){return"0"},_s.SYM_L.get=function(){return"1"},_s.SYM_A.get=function(){return"2"},ys.prototype.interfaces_=function(){return[]},ys.prototype.getClass=function(){return ys},ys.toDimensionSymbol=function(t){switch(t){case ys.FALSE:return ys.SYM_FALSE;case ys.TRUE:return ys.SYM_TRUE;case ys.DONTCARE:return ys.SYM_DONTCARE;case ys.P:return ys.SYM_P;case ys.L:return ys.SYM_L;case ys.A:return ys.SYM_A}throw new Fi("Unknown dimension value: "+t)},ys.toDimensionValue=function(t){switch(no.toUpperCase(t)){case ys.SYM_FALSE:return ys.FALSE;case ys.SYM_TRUE:return ys.TRUE;case ys.SYM_DONTCARE:return ys.DONTCARE;case ys.SYM_P:return ys.P;case ys.SYM_L:return ys.L;case ys.SYM_A:return ys.A}throw new Fi("Unknown dimension symbol: "+t)},Object.defineProperties(ys,_s);var ms=function(){};ms.prototype.filter=function(t){},ms.prototype.interfaces_=function(){return[]},ms.prototype.getClass=function(){return ms};var vs=function(){};vs.prototype.filter=function(t,e){},vs.prototype.isDone=function(){},vs.prototype.isGeometryChanged=function(){},vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs};var Es=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new Fi("geometries must not contain null elements")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new ho,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(),A=0;A<r.length;A++)t[++e]=r[A];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 A=0;A<this._geometries.length;A++)if(!this._geometries[A].equalsExact(r._geometries[A],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();gs.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=ys.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=ys.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 ps(gs.asList(this._geometries)),n=new ps(gs.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],A=arguments[0],i=this.getNumGeometries(),o=A.getNumGeometries(),s=0;s<i&&s<o;){var a=this.getGeometryN(s),u=A.getGeometryN(s),c=a.compareToSameClass(u,r);if(0!==c)return c;s++}return s<i?1:s<o?-1:0}},e.prototype.apply=function(){var t=this;if(Ki(arguments[0],Po))for(var e=arguments[0],n=0;n<this._geometries.length;n++)t._geometries[n].apply(e);else if(Ki(arguments[0],vs)){var r=arguments[0];if(0===this._geometries.length)return null;for(var A=0;A<this._geometries.length&&(t._geometries[A].apply(r),!r.isDone());A++);r.isGeometryChanged()&&this.geometryChanged()}else if(Ki(arguments[0],ms)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)t._geometries[o].apply(i)}else if(Ki(arguments[0],To)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)t._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),bo.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}(Mo),ws=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Mo.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()?ys.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 bs(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[fs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Es),bs=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=ko.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}};bs.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)},bs.prototype.getBoundary=function(){return this._geom instanceof Rs?this.boundaryLineString(this._geom):this._geom instanceof ws?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},bs.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()])},bs.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},bs.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new Ho;this._endpointMap=new ls;for(var r=0;r<t.getNumGeometries();r++){var A=t.getGeometryN(r);0!==A.getNumPoints()&&(e.addEndpoint(A.getCoordinateN(0)),e.addEndpoint(A.getCoordinateN(A.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;e._bnRule.isInBoundary(s)&&n.add(o.getKey())}return Wo.toCoordinateArray(n)},bs.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Is,this._endpointMap.put(t,e)),e.count++},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs},bs.getBoundary=function(){return 1===arguments.length?new bs(arguments[0]).getBoundary():2===arguments.length?new bs(arguments[0],arguments[1]).getBoundary():void 0};var Is=function(){this.count=null};function Cs(){}function xs(){}Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is};var Ns=function(){};function Ss(){}function Ds(){}function Ls(){}var Ts=function(){},Ms={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts},Ts.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Ts.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new Ss,n=new Cs;return t.printStackTrace(n),e.toString()}if(2===arguments.length){var r=arguments[1],A="";new xs(Ts.getStackTrace(arguments[0]));for(var i=new Ls,o=0;o<r;o++)try{A+=i.readLine()+Ts.NEWLINE}catch(t){if(!(t instanceof Ds))throw t;bo.shouldNeverReachHere()}return A}},Ts.split=function(t,e){for(var n=e.length,r=new Ho,A=""+t,i=A.indexOf(e);i>=0;){var o=A.substring(0,i);r.add(o),i=(A=A.substring(i+n)).indexOf(e)}A.length>0&&r.add(A);for(var s=new Array(r.size()).fill(null),a=0;a<s.length;a++)s[a]=r.get(a);return s},Ts.toString=function(){if(1===arguments.length){var t=arguments[0];return Ts.SIMPLE_ORDINATE_FORMAT.format(t)}},Ts.spaces=function(t){return Ts.chars(" ",t)},Ms.NEWLINE.get=function(){return lo.getProperty("line.separator")},Ms.SIMPLE_ORDINATE_FORMAT.get=function(){return new Ns},Object.defineProperties(Ts,Ms);var Os=function(){};Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os},Os.copyCoord=function(t,e,n,r){for(var A=Math.min(t.getDimension(),n.getDimension()),i=0;i<A;i++)n.setOrdinate(r,i,t.getOrdinate(e,i))},Os.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&(t.getOrdinate(0,so.X)===t.getOrdinate(e-1,so.X)&&t.getOrdinate(0,so.Y)===t.getOrdinate(e-1,so.Y))},Os.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),A=0;A<n;A++)for(var i=0;i<r;i++){var o=t.getOrdinate(A,i),s=e.getOrdinate(A,i);if(t.getOrdinate(A,i)!==e.getOrdinate(A,i)&&(!Gi.isNaN(o)||!Gi.isNaN(s)))return!1}return!0},Os.extend=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();if(Os.copy(e,0,r,0,A),A>0)for(var i=A;i<n;i++)Os.copy(e,A-1,r,i,1);return r},Os.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Os.swap(t,r,e-r)},Os.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var A=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,A)}},Os.copy=function(t,e,n,r,A){for(var i=0;i<A;i++)Os.copyCoord(t,e+i,n,r+i)},Os.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new to;r.append("(");for(var A=0;A<e;A++){A>0&&r.append(" ");for(var i=0;i<n;i++)i>0&&r.append(","),r.append(Ts.toString(t.getOrdinate(A,i)))}return r.append(")"),r.toString()}},Os.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Os.createClosedRing(t,e,4):e.getOrdinate(0,so.X)===e.getOrdinate(n-1,so.X)&&e.getOrdinate(0,so.Y)===e.getOrdinate(n-1,so.Y)?e:Os.createClosedRing(t,e,n+1)},Os.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();Os.copy(e,0,r,0,A);for(var i=A;i<n;i++)Os.copy(e,0,r,i,1);return r};var Rs=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),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ho:this._points.expandEnvelope(new ho)},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 A=0;A<this._points.size();A++)if(!this.equal(this._points.getCoordinate(A),r._points.getCoordinate(A),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=this,e=0;e<Math.trunc(this._points.size()/2);e++){var n=t._points.size()-1-e;if(!t._points.getCoordinate(e).equals(t._points.getCoordinate(n)))return t._points.getCoordinate(e).compareTo(t._points.getCoordinate(n))>0&&Os.reverse(t._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?ys.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 Do.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Os.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 A=arguments[0];return arguments[1].compare(this._points,A._points)}},e.prototype.apply=function(){if(Ki(arguments[0],Po))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(Ki(arguments[0],vs)){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 if(Ki(arguments[0],ms)){arguments[0].filter(this)}else if(Ki(arguments[0],To)){arguments[0].filter(this)}},e.prototype.getBoundary=function(){return new bs(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 Fi("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[fs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(Mo),Ps=function(){};Ps.prototype.interfaces_=function(){return[]},Ps.prototype.getClass=function(){return Ps};var ks=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),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ho;var t=new ho;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 ys.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(Ki(arguments[0],Po)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(Ki(arguments[0],vs)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else if(Ki(arguments[0],ms)){arguments[0].filter(this)}else if(Ki(arguments[0],To)){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([])),bo.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Ps]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(Mo),Bs=function(){};Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs};var Fs=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 Fi("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new Fi("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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 A=0;A<this._holes.length;A++)for(var i=this._holes[A].getCoordinates(),o=0;o<i.length;o++)t[++e]=i[o];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(Do.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(Do.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 A=t.getY(n);if(A!==e.getMinY()&&A!==e.getMaxY())return!1}for(var i=t.getX(0),o=t.getY(0),s=1;s<=4;s++){var a=t.getX(s),u=t.getY(s);if(a!==i===(u!==o))return!1;i=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,A=this._shell,i=r._shell;if(!A.equalsExact(i,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);gs.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);lo.arraycopy(e.getCoordinates(),0,r,0,r.length);var A=Wo.minCoordinate(e.getCoordinates());Wo.scroll(r,A),lo.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],Do.isCCW(e.getCoordinates())===n&&Wo.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],A=arguments[0],i=this._shell,o=A._shell,s=i.compareToSameClass(o,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=A.getNumInteriorRing(),c=0;c<a&&c<u;){var l=this.getInteriorRingN(c),f=A.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){var e=this;if(Ki(t,Po)){this._shell.apply(t);for(var n=0;n<this._holes.length;n++)e._holes[n].apply(t)}else if(Ki(t,vs)){if(this._shell.apply(t),!t.isDone())for(var r=0;r<this._holes.length&&(e._holes[r].apply(t),!t.isDone());r++);t.isGeometryChanged()&&this.geometryChanged()}else if(Ki(t,ms))t.filter(this);else if(Ki(t,To)){t.filter(this),this._shell.apply(t);for(var A=0;A<this._holes.length;A++)e._holes[A].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[Bs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(Mo),Gs=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Mo.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 ys.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[Ps]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Es),Us=function(t){function e(e,n){e instanceof Yi&&n instanceof na&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Mo.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return ys.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Os.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new Fi("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Fi("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}(Rs),Qs=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Mo.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 Ho,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 A=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(A))},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[Bs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Es),Vs=function(t){this._factory=t||null,this._isUserDataCopied=!1},zs={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Vs.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Vs.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Vs.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Es?this.editGeometryCollection(t,e):t instanceof Fs?this.editPolygon(t,e):t instanceof ks||t instanceof Rs?e.edit(t,this._factory):(bo.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Vs.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Ho,A=0;A<n.getNumGeometries();A++){var i=this.edit(n.getGeometryN(A),e);null===i||i.isEmpty()||r.add(i)}return n.getClass()===Gs?this._factory.createMultiPoint(r.toArray([])):n.getClass()===ws?this._factory.createMultiLineString(r.toArray([])):n.getClass()===Qs?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},Vs.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 A=new Ho,i=0;i<n.getNumInteriorRing();i++){var o=this.edit(n.getInteriorRingN(i),e);null===o||o.isEmpty()||A.add(o)}return this._factory.createPolygon(r,A.toArray([]))},Vs.prototype.interfaces_=function(){return[]},Vs.prototype.getClass=function(){return Vs},Vs.GeometryEditorOperation=function(){},zs.NoOpGeometryOperation.get=function(){return qs},zs.CoordinateOperation.get=function(){return Ys},zs.CoordinateSequenceOperation.get=function(){return js},Object.defineProperties(Vs,zs);var qs=function(){};qs.prototype.edit=function(t,e){return t},qs.prototype.interfaces_=function(){return[Vs.GeometryEditorOperation]},qs.prototype.getClass=function(){return qs};var Ys=function(){};Ys.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof Us?e.createLinearRing(n):t instanceof Rs?e.createLineString(n):t instanceof ks?n.length>0?e.createPoint(n[0]):e.createPoint():t},Ys.prototype.interfaces_=function(){return[Vs.GeometryEditorOperation]},Ys.prototype.getClass=function(){return Ys};var js=function(){};js.prototype.edit=function(t,e){return t instanceof Us?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Rs?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ks?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},js.prototype.interfaces_=function(){return[Vs.GeometryEditorOperation]},js.prototype.getClass=function(){return js};var Hs=function(){var t=this;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 e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new Yi}else if(Ki(arguments[0],so)){var r=arguments[0];if(null===r)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var A=0;A<this._coordinates.length;A++)t._coordinates[A]=r.getCoordinateCopy(A)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)t._coordinates[u]=new Yi}},Xs={serialVersionUID:{configurable:!0}};Hs.prototype.setOrdinate=function(t,e,n){switch(e){case so.X:this._coordinates[t].x=n;break;case so.Y:this._coordinates[t].y=n;break;case so.Z:this._coordinates[t].z=n;break;default:throw new Fi("invalid ordinateIndex")}},Hs.prototype.size=function(){return this._coordinates.length},Hs.prototype.getOrdinate=function(t,e){switch(e){case so.X:return this._coordinates[t].x;case so.Y:return this._coordinates[t].y;case so.Z:return this._coordinates[t].z}return Gi.NaN},Hs.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}},Hs.prototype.getCoordinateCopy=function(t){return new Yi(this._coordinates[t])},Hs.prototype.getDimension=function(){return this._dimension},Hs.prototype.getX=function(t){return this._coordinates[t].x},Hs.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 Hs(t,this._dimension)},Hs.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},Hs.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 Hs(t,this._dimension)},Hs.prototype.toString=function(){if(this._coordinates.length>0){var t=new to(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"()"},Hs.prototype.getY=function(t){return this._coordinates[t].y},Hs.prototype.toCoordinateArray=function(){return this._coordinates},Hs.prototype.interfaces_=function(){return[so,qi]},Hs.prototype.getClass=function(){return Hs},Xs.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Hs,Xs);var $s=function(){},Ws={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};$s.prototype.readResolve=function(){return $s.instance()},$s.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new Hs(arguments[0]);if(Ki(arguments[0],so))return new Hs(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new Hs(t):new Hs(t,e)}},$s.prototype.interfaces_=function(){return[Xi,qi]},$s.prototype.getClass=function(){return $s},$s.instance=function(){return $s.instanceObject},Ws.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ws.instanceObject.get=function(){return new $s},Object.defineProperties($s,Ws);var Ks=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 Ho,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 As;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(ts),Zs=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 ta){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}},Js={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Zs.prototype.equals=function(t){if(!(t instanceof Zs))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Zs.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new eo(n).compareTo(new eo(r))},Zs.prototype.getScale=function(){return this._scale},Zs.prototype.isFloating=function(){return this._modelType===Zs.FLOATING||this._modelType===Zs.FLOATING_SINGLE},Zs.prototype.getType=function(){return this._modelType},Zs.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Zs.FLOATING?t="Floating":this._modelType===Zs.FLOATING_SINGLE?t="Floating-Single":this._modelType===Zs.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Zs.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return Gi.isNaN(t)||this._modelType===Zs.FLOATING_SINGLE?t:this._modelType===Zs.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof Yi){var e=arguments[0];if(this._modelType===Zs.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Zs.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Zs.FLOATING?t=16:this._modelType===Zs.FLOATING_SINGLE?t=6:this._modelType===Zs.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Zs.prototype.setScale=function(t){this._scale=Math.abs(t)},Zs.prototype.interfaces_=function(){return[qi,Qi]},Zs.prototype.getClass=function(){return Zs},Zs.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Js.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Js.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Zs,Js);var ta=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ea={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ta.prototype.readResolve=function(){return ta.nameToTypeMap.get(this._name)},ta.prototype.toString=function(){return this._name},ta.prototype.interfaces_=function(){return[qi]},ta.prototype.getClass=function(){return ta},ea.serialVersionUID.get=function(){return-552860263173159e4},ea.nameToTypeMap.get=function(){return new Ks},Object.defineProperties(ta,ea),Zs.Type=ta,Zs.FIXED=new ta("FIXED"),Zs.FLOATING=new ta("FLOATING"),Zs.FLOATING_SINGLE=new ta("FLOATING SINGLE");var na=function t(){this._precisionModel=new Zs,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Ki(arguments[0],Xi)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Zs&&(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]))},ra={serialVersionUID:{configurable:!0}};na.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Yi(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Yi(t.getMinX(),t.getMinY()),new Yi(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Yi(t.getMinX(),t.getMinY()),new Yi(t.getMinX(),t.getMaxY()),new Yi(t.getMaxX(),t.getMaxY()),new Yi(t.getMaxX(),t.getMinY()),new Yi(t.getMinX(),t.getMinY())]),null)},na.prototype.createLineString=function(t){return t?t instanceof Array?new Rs(this.getCoordinateSequenceFactory().create(t),this):Ki(t,so)?new Rs(t,this):void 0:new Rs(this.getCoordinateSequenceFactory().create([]),this)},na.prototype.createMultiLineString=function(){return 0===arguments.length?new ws(null,this):1===arguments.length?new ws(arguments[0],this):void 0},na.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,A=t.iterator();A.hasNext();){var i=A.next(),o=i.getClass();null===e&&(e=o),o!==e&&(n=!0),i.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(na.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Fs)return this.createMultiPolygon(na.toPolygonArray(t));if(s instanceof Rs)return this.createMultiLineString(na.toLineStringArray(t));if(s instanceof ks)return this.createMultiPoint(na.toPointArray(t));bo.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},na.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},na.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Yi){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Ki(arguments[0],so))return new ks(arguments[0],this)}},na.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},na.prototype.createPolygon=function(){if(0===arguments.length)return new Fs(null,null,this);if(1===arguments.length){if(Ki(arguments[0],so)){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 Us){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){return new Fs(arguments[0],arguments[1],this)}},na.prototype.getSRID=function(){return this._SRID},na.prototype.createGeometryCollection=function(){return 0===arguments.length?new Es(null,this):1===arguments.length?new Es(arguments[0],this):void 0},na.prototype.createGeometry=function(t){return new Vs(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},na.prototype.getPrecisionModel=function(){return this._precisionModel},na.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(Ki(arguments[0],so))return new Us(arguments[0],this)}},na.prototype.createMultiPolygon=function(){return 0===arguments.length?new Qs(null,this):1===arguments.length?new Qs(arguments[0],this):void 0},na.prototype.createMultiPoint=function(){if(0===arguments.length)return new Gs(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Gs(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Ki(arguments[0],so)){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 A=this.getCoordinateSequenceFactory().create(1,e.getDimension());Os.copy(e,r,A,0,1),n[r]=this.createPoint(A)}return this.createMultiPoint(n)}}},na.prototype.interfaces_=function(){return[qi]},na.prototype.getClass=function(){return na},na.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},na.getDefaultCoordinateSequenceFactory=function(){return $s.instance()},na.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},na.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ra.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(na,ra);var Aa=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ia=function(t){this.geometryFactory=t||new na};ia.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!oa[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==Aa.indexOf(n)?oa[n].apply(this,[e.coordinates]):"GeometryCollection"===n?oa[n].apply(this,[e.geometries]):oa[n].apply(this,[e])},ia.prototype.write=function(t){var e=t.getGeometryType();if(!sa[e])throw new Error("Geometry is not supported");return sa[e].apply(this,[t])};var oa={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!oa[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=oa.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 Yi(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new Yi(t[0],t[1]),new Yi(t[2],t[1]),new Yi(t[2],t[3]),new Yi(t[0],t[3]),new Yi(t[0],t[1])])},Point:function(t){var e=new Yi(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(oa.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=oa.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(oa.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=oa.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],A=1;A<t.length;++A){var i=t[A],o=oa.coordinates.apply(this,[i]),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(oa.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)}},sa={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:sa.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=sa.Point.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var A=n[r];e.push(sa.coordinate.apply(this,[A]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=sa.LineString.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=sa.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var A=t._holes[r],i=sa.LineString.apply(this,[A]);e.push(i.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=sa.Polygon.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=r.getGeometryType();e.push(sa[A].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},aa=function(t){this.geometryFactory=t||new na,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ia(this.geometryFactory)};aa.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Zs.FIXED&&this.reducePrecision(e),e},aa.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 ua=function(){this.parser=new ia(this.geometryFactory)};ua.prototype.write=function(t){return this.parser.write(t)};var ca=function(){},la={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};function fa(t){this.message=t||""}function ha(){this.array_=[]}ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca},ca.opposite=function(t){return t===ca.LEFT?ca.RIGHT:t===ca.RIGHT?ca.LEFT:t},la.ON.get=function(){return 0},la.LEFT.get=function(){return 1},la.RIGHT.get=function(){return 2},Object.defineProperties(ca,la),fa.prototype=new Error,fa.prototype.name="EmptyStackException",ha.prototype=new Yo,ha.prototype.add=function(t){return this.array_.push(t),!0},ha.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},ha.prototype.push=function(t){return this.array_.push(t),t},ha.prototype.pop=function(t){if(0===this.array_.length)throw new fa;return this.array_.pop()},ha.prototype.peek=function(){if(0===this.array_.length)throw new fa;return this.array_[this.array_.length-1]},ha.prototype.empty=function(){return 0===this.array_.length},ha.prototype.isEmpty=function(){return this.empty()},ha.prototype.search=function(t){return this.array_.indexOf(t)},ha.prototype.size=function(){return this.array_.length},ha.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var pa=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};pa.prototype.getCoordinate=function(){return this._minCoord},pa.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},pa.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();bo.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=Do.computeOrientation(this._minCoord,n,e),A=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===Do.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===Do.CLOCKWISE)&&(A=!0),A&&(this._minIndex=this._minIndex-1)},pa.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=ca.LEFT;return n[e].y<n[e+1].y&&(r=ca.RIGHT),r},pa.prototype.getEdge=function(){return this._orientedDe},pa.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),r=0;r<n.length-1;r++)(null===e._minCoord||n[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])},pa.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)},pa.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}bo.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)===ca.LEFT&&(this._orientedDe=this._minDe.getSym())},pa.prototype.interfaces_=function(){return[]},pa.prototype.getClass=function(){return pa};var da=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new Yi(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}(Eo),ga=function(){this.array_=[]};ga.prototype.addLast=function(t){this.array_.push(t)},ga.prototype.removeFirst=function(){return this.array_.shift()},ga.prototype.isEmpty=function(){return 0===this.array_.length};var ya=function(){this._finder=null,this._dirEdgeList=new Ho,this._nodes=new Ho,this._rightMostCoord=null,this._env=null,this._finder=new pa};ya.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},ya.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},ya.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 da("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var A=t.getEdges().iterator();A.hasNext();){var i=A.next();i.setVisited(!0),this.copySymDepths(i)}},ya.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(ca.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},ya.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},ya.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(ca.RIGHT)>=1&&e.getDepth(ca.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ya.prototype.computeDepths=function(t){var e=new As,n=new ga,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var A=n.removeFirst();e.add(A),this.computeNodeDepth(A);for(var i=A.getEdges().iterator();i.hasNext();){var o=i.next().getSym();if(!o.isVisited()){var s=o.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},ya.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},ya.prototype.getEnvelope=function(){if(null===this._env){for(var t=new ho,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},ya.prototype.addReachable=function(t){var e=new ha;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},ya.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(ca.LEFT,t.getDepth(ca.RIGHT)),e.setDepth(ca.RIGHT,t.getDepth(ca.LEFT))},ya.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 A=r.getSym().getNode();A.isVisited()||e.push(A)}},ya.prototype.getNodes=function(){return this._nodes},ya.prototype.getDirectedEdges=function(){return this._dirEdgeList},ya.prototype.interfaces_=function(){return[Qi]},ya.prototype.getClass=function(){return ya};var _a=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[ca.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var A=0;A<this.location.length;A++)this.location[A]=r.location[A]}}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[ca.ON]=i,this.location[ca.LEFT]=o,this.location[ca.RIGHT]=s}};_a.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},_a.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==$i.NONE)return!1;return!0},_a.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===$i.NONE&&(this.location[e]=t)},_a.prototype.isLine=function(){return 1===this.location.length},_a.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[ca.ON]=this.location[ca.ON],e[ca.LEFT]=$i.NONE,e[ca.RIGHT]=$i.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===$i.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},_a.prototype.getLocations=function(){return this.location},_a.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[ca.LEFT];this.location[ca.LEFT]=this.location[ca.RIGHT],this.location[ca.RIGHT]=t},_a.prototype.toString=function(){var t=new to;return this.location.length>1&&t.append($i.toLocationSymbol(this.location[ca.LEFT])),t.append($i.toLocationSymbol(this.location[ca.ON])),this.location.length>1&&t.append($i.toLocationSymbol(this.location[ca.RIGHT])),t.toString()},_a.prototype.setLocations=function(t,e,n){this.location[ca.ON]=t,this.location[ca.LEFT]=e,this.location[ca.RIGHT]=n},_a.prototype.get=function(t){return t<this.location.length?this.location[t]:$i.NONE},_a.prototype.isArea=function(){return this.location.length>1},_a.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===$i.NONE)return!0;return!1},_a.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(ca.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},_a.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations($i.NONE)},_a.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},_a.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a};var ma=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 _a(e),this.elt[1]=new _a(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new _a(n.elt[0]),this.elt[1]=new _a(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.elt[0]=new _a($i.NONE),this.elt[1]=new _a($i.NONE),this.elt[r].setLocation(A)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new _a(i,o,s),this.elt[1]=new _a(i,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new _a($i.NONE,$i.NONE,$i.NONE),this.elt[1]=new _a($i.NONE,$i.NONE,$i.NONE),this.elt[a].setLocations(u,c,l)}};ma.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},ma.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},ma.prototype.isNull=function(t){return this.elt[t].isNull()},ma.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)}},ma.prototype.isLine=function(t){return this.elt[t].isLine()},ma.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)null===e.elt[n]&&null!==t.elt[n]?e.elt[n]=new _a(t.elt[n]):e.elt[n].merge(t.elt[n])},ma.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},ma.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(ca.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},ma.prototype.toString=function(){var t=new to;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()},ma.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()}},ma.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},ma.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(ca.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this.elt[n].setLocation(r,A)}},ma.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},ma.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},ma.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new _a(this.elt[t].location[0]))},ma.prototype.interfaces_=function(){return[]},ma.prototype.getClass=function(){return ma},ma.toLineLabel=function(t){for(var e=new ma($i.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var va=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Ho,this._pts=new Ho,this._label=new ma($i.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Ho,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};va.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=Do.isCCW(this._ring.getCoordinates())},va.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},va.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,r=!0;do{if(null===n)throw new da("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new da("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var A=n.getLabel();bo.isTrue(A.isArea()),e.mergeLabel(A),e.addPoints(n.getEdge(),n.isForward(),r),r=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},va.prototype.getLinearRing=function(){return this._ring},va.prototype.getCoordinate=function(t){return this._pts.get(t)},va.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode().getEdges().getOutgoingDegree(t);n>t._maxNodeDegree&&(t._maxNodeDegree=n),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},va.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var A=1;n&&(A=0);for(var i=A;i<r.length;i++)this._pts.add(r[i])}else{var o=r.length-2;n&&(o=r.length-1);for(var s=o;s>=0;s--)this._pts.add(r[s])}},va.prototype.isHole=function(){return this._isHole},va.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},va.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Do.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},va.prototype.addHole=function(t){this._holes.add(t)},va.prototype.isShell=function(){return null===this._shell},va.prototype.getLabel=function(){return this._label},va.prototype.getEdges=function(){return this._edges},va.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},va.prototype.getShell=function(){return this._shell},va.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,ca.RIGHT);if(n===$i.NONE)return null;if(this._label.getLocation(e)===$i.NONE)return this._label.setLocation(e,n),null}},va.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},va.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)},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var Ea=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}(va),wa=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 Ho,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ea(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}(va),ba=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}};ba.prototype.setVisited=function(t){this._isVisited=t},ba.prototype.setInResult=function(t){this._isInResult=t},ba.prototype.isCovered=function(){return this._isCovered},ba.prototype.isCoveredSet=function(){return this._isCoveredSet},ba.prototype.setLabel=function(t){this._label=t},ba.prototype.getLabel=function(){return this._label},ba.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ba.prototype.updateIM=function(t){bo.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ba.prototype.isInResult=function(){return this._isInResult},ba.prototype.isVisited=function(){return this._isVisited},ba.prototype.interfaces_=function(){return[]},ba.prototype.getClass=function(){return ba};var Ia=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 ma(0,$i.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=$i.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==$i.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 ma(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var t=this;if(arguments[0]instanceof e){var n=arguments[0];this.mergeLabel(n._label)}else if(arguments[0]instanceof ma)for(var r=arguments[0],A=0;A<2;A++){var i=t.computeMergedLocation(r,A);t._label.getLocation(A)===$i.NONE&&t._label.setLocation(A,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=$i.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;if(e===$i.BOUNDARY)n=$i.INTERIOR;else n=$i.BOUNDARY;this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ba),Ca=function(){this.nodeMap=new ls,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ca.prototype.find=function(t){return this.nodeMap.get(t)},Ca.prototype.addNode=function(){if(arguments[0]instanceof Yi){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 Ia){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Ca.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Ca.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ca.prototype.values=function(){return this.nodeMap.values()},Ca.prototype.getBoundaryNodes=function(t){for(var e=new Ho,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===$i.BOUNDARY&&e.add(r)}return e},Ca.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ca.prototype.interfaces_=function(){return[]},Ca.prototype.getClass=function(){return Ca};var xa=function(){},Na={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};xa.prototype.interfaces_=function(){return[]},xa.prototype.getClass=function(){return xa},xa.isNorthern=function(t){return t===xa.NE||t===xa.NW},xa.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},xa.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},xa.isInHalfPlane=function(t,e){return e===xa.SE?t===xa.SE||t===xa.SW:t===e||t===e+1},xa.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 Fi("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?xa.NE:xa.SE:e>=0?xa.NW:xa.SW}if(arguments[0]instanceof Yi&&arguments[1]instanceof Yi){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new Fi("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?xa.NE:xa.SE:r.y>=n.y?xa.NW:xa.SW}},Na.NE.get=function(){return 0},Na.NW.get=function(){return 1},Na.SW.get=function(){return 2},Na.SE.get=function(){return 3},Object.defineProperties(xa,Na);var Sa=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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._edge=A,this.init(i,o),this._label=s}};Sa.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:Do.computeOrientation(t._p0,t._p1,this._p1)},Sa.prototype.getDy=function(){return this._dy},Sa.prototype.getCoordinate=function(){return this._p0},Sa.prototype.setNode=function(t){this._node=t},Sa.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),A=n.substring(r+1);t.print(" "+A+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Sa.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Sa.prototype.getDirectedCoordinate=function(){return this._p1},Sa.prototype.getDx=function(){return this._dx},Sa.prototype.getLabel=function(){return this._label},Sa.prototype.getEdge=function(){return this._edge},Sa.prototype.getQuadrant=function(){return this._quadrant},Sa.prototype.getNode=function(){return this._node},Sa.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},Sa.prototype.computeLabel=function(t){},Sa.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=xa.quadrant(this._dx,this._dy),bo.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Sa.prototype.interfaces_=function(){return[Qi]},Sa.prototype.getClass=function(){return Sa};var Da=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 ma(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 da("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=this,e=!0,n=0;n<2;n++)t._label.isArea(n)&&t._label.getLocation(n,ca.LEFT)===$i.INTERIOR&&t._label.getLocation(n,ca.RIGHT)===$i.INTERIOR||(e=!1);return e},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[ca.LEFT]+"/"+this._depth[ca.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,$i.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,$i.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===ca.LEFT&&(r=-1);var A=ca.opposite(t),i=e+n*r;this.setDepth(t,e),this.setDepth(A,i)},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===$i.EXTERIOR&&e===$i.INTERIOR?1:t===$i.INTERIOR&&e===$i.EXTERIOR?-1:0},e}(Sa),La=function(){};La.prototype.createNode=function(t){return new Ia(t,null)},La.prototype.interfaces_=function(){return[]},La.prototype.getClass=function(){return La};var Ta=function(){if(this._edges=new Ho,this._nodes=null,this._edgeEndList=new Ho,0===arguments.length)this._nodes=new Ca(new La);else if(1===arguments.length){var t=arguments[0];this._nodes=new Ca(t)}};Ta.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)}},Ta.prototype.find=function(t){return this._nodes.find(t)},Ta.prototype.addNode=function(){if(arguments[0]instanceof Ia){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof Yi){var e=arguments[0];return this._nodes.addNode(e)}},Ta.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ta.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){t.next().getEdges().linkResultDirectedEdges()}},Ta.prototype.debugPrintln=function(t){lo.out.println(t)},Ta.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)===$i.BOUNDARY},Ta.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){t.next().getEdges().linkAllDirectedEdges()}},Ta.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&(Do.computeOrientation(t,e,r)===Do.COLLINEAR&&xa.quadrant(t,e)===xa.quadrant(n,r))},Ta.prototype.getEdgeEnds=function(){return this._edgeEndList},Ta.prototype.debugPrint=function(t){lo.out.print(t)},Ta.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ta.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var A=n._edges.get(r),i=A.getCoordinates();if(n.matchInSameDirection(t,e,i[0],i[1]))return A;if(n.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return A}return null},Ta.prototype.insertEdge=function(t){this._edges.add(t)},Ta.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ta.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();e._edges.add(r);var A=new Da(r,!0),i=new Da(r,!1);A.setSym(i),i.setSym(A),e.add(A),e.add(i)}},Ta.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ta.prototype.getNodes=function(){return this._nodes.values()},Ta.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),A=r.getCoordinates();if(t.equals(A[0])&&e.equals(A[1]))return r}return null},Ta.prototype.interfaces_=function(){return[]},Ta.prototype.getClass=function(){return Ta},Ta.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){e.next().getEdges().linkResultDirectedEdges()}};var Ma=function(){this._geometryFactory=null,this._shellList=new Ho;var t=arguments[0];this._geometryFactory=t};Ma.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var A=r.next();A.isHole()?n.add(A):e.add(A)}},Ma.prototype.computePolygons=function(t){for(var e=new Ho,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Ma.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var A=this.findEdgeRingContaining(r,t);if(null===A)throw new da("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(A)}}},Ma.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Ho,A=t.iterator();A.hasNext();){var i=A.next();if(i.getMaxNodeDegree()>2){i.linkDirectedEdgesForMinimalEdgeRings();var o=i.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),e.add(s)):n.addAll(o)}else r.add(i)}return r},Ma.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},Ma.prototype.buildMaximalEdgeRings=function(t){for(var e=new Ho,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var A=new wa(r,this._geometryFactory);e.add(A),A.setInResult()}}return e},Ma.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ma.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ma.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),A=n.getCoordinateN(0),i=null,o=null,s=e.iterator();s.hasNext();){var a=s.next(),u=a.getLinearRing(),c=u.getEnvelopeInternal();null!==i&&(o=i.getLinearRing().getEnvelopeInternal());var l=!1;c.contains(r)&&Do.isPointInRing(A,u.getCoordinates())&&(l=!0),l&&(null===i||o.contains(c))&&(i=a)}return i},Ma.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var A=r.next();A.isHole()||(n=A,e++)}return bo.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ma.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];Ta.linkResultDirectedEdges(arguments[1]);var n=this.buildMaximalEdgeRings(e),r=new Ho,A=this.buildMinimalEdgeRings(n,this._shellList,r);this.sortShellsAndHoles(A,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},Ma.prototype.interfaces_=function(){return[]},Ma.prototype.getClass=function(){return Ma};var Oa=function(){};Oa.prototype.getBounds=function(){},Oa.prototype.interfaces_=function(){return[]},Oa.prototype.getClass=function(){return Oa};var Ra=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ra.prototype.getItem=function(){return this._item},Ra.prototype.getBounds=function(){return this._bounds},Ra.prototype.interfaces_=function(){return[Oa,qi]},Ra.prototype.getClass=function(){return Ra};var Pa=function(){this._size=null,this._items=null,this._size=0,this._items=new Ho,this._items.add(null)};Pa.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},Pa.prototype.size=function(){return this._size},Pa.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);2*t<=this._size&&((n=2*t)!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)},Pa.prototype.clear=function(){this._size=0,this._items.clear()},Pa.prototype.isEmpty=function(){return 0===this._size},Pa.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)},Pa.prototype.interfaces_=function(){return[]},Pa.prototype.getClass=function(){return Pa};var ka=function(){};ka.prototype.visitItem=function(t){},ka.prototype.interfaces_=function(){return[]},ka.prototype.getClass=function(){return ka};var Ba=function(){};Ba.prototype.insert=function(t,e){},Ba.prototype.remove=function(t,e){},Ba.prototype.query=function(){},Ba.prototype.interfaces_=function(){return[]},Ba.prototype.getClass=function(){return Ba};var Fa=function(){if(this._childBoundables=new Ho,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ga={serialVersionUID:{configurable:!0}};Fa.prototype.getLevel=function(){return this._level},Fa.prototype.size=function(){return this._childBoundables.size()},Fa.prototype.getChildBoundables=function(){return this._childBoundables},Fa.prototype.addChildBoundable=function(t){bo.isTrue(null===this._bounds),this._childBoundables.add(t)},Fa.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Fa.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Fa.prototype.interfaces_=function(){return[Oa,qi]},Fa.prototype.getClass=function(){return Fa},Ga.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Fa,Ga);var Ua=function(){};Ua.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Ua.min=function(t){return Ua.sort(t),t.get(0)},Ua.sort=function(t,e){var n=t.toArray();e?gs.sort(n,e):gs.sort(n);for(var r=t.iterator(),A=0,i=n.length;A<i;A++)r.next(),r.set(n[A])},Ua.singletonList=function(t){var e=new Ho;return e.add(t),e};var Qa=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()};Qa.prototype.expandToQueue=function(t,e){var n=Qa.isComposite(this._boundable1),r=Qa.isComposite(this._boundable2);if(n&&r)return Qa.area(this._boundable1)>Qa.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 Fi("neither boundable is composite")},Qa.prototype.isLeaves=function(){return!(Qa.isComposite(this._boundable1)||Qa.isComposite(this._boundable2))},Qa.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Qa.prototype.expand=function(t,e,n,r){for(var A=t.getChildBoundables().iterator();A.hasNext();){var i=A.next(),o=new Qa(i,e,this._itemDistance);o.getDistance()<r&&n.add(o)}},Qa.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},Qa.prototype.getDistance=function(){return this._distance},Qa.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Qa.prototype.interfaces_=function(){return[Qi]},Qa.prototype.getClass=function(){return Qa},Qa.area=function(t){return t.getBounds().getArea()},Qa.isComposite=function(t){return t instanceof Fa};var Va=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Ho,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];bo.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},za={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Va.prototype.getNodeCapacity=function(){return this._nodeCapacity},Va.prototype.lastNode=function(t){return t.get(t.size()-1)},Va.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 Fa?t+=this.size(n):n instanceof Ra&&(t+=1)}return t}},Va.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var A=r.next();A instanceof Ra&&A.getItem()===e&&(n=A)}return null!==n&&(t.getChildBoundables().remove(n),!0)},Va.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Ho:t}if(1===arguments.length){for(var e=arguments[0],n=new Ho,r=e.getChildBoundables().iterator();r.hasNext();){var A=r.next();if(A instanceof Fa){var i=this.itemsTree(A);null!==i&&n.add(i)}else A instanceof Ra?n.add(A.getItem()):bo.shouldNeverReachHere()}return n.size()<=0?null:n}},Va.prototype.insert=function(t,e){bo.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ra(t,e))},Va.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Ho;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];if(bo.isTrue(n>-2),r.getLevel()===n)return A.add(r),null;for(var i=r.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Fa?this.boundablesAtLevel(n,o,A):(bo.isTrue(o instanceof Ra),-1===n&&A.add(o))}return null}},Va.prototype.query=function(){var t=this;if(1===arguments.length){var e=arguments[0];this.build();var n=new Ho;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}if(2===arguments.length){var r=arguments[0],A=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,A)}else if(3===arguments.length)if(Ki(arguments[2],ka)&&arguments[0]instanceof Object&&arguments[1]instanceof Fa)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);t.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Fa?t.query(i,u,o):u instanceof Ra?o.visitItem(u.getItem()):bo.shouldNeverReachHere())}else if(Ki(arguments[2],Yo)&&arguments[0]instanceof Object&&arguments[1]instanceof Fa)for(var c=arguments[0],l=arguments[2],f=arguments[1].getChildBoundables(),h=0;h<f.size();h++){var p=f.get(h);t.getIntersectsOp().intersects(p.getBounds(),c)&&(p instanceof Fa?t.query(c,p,l):p instanceof Ra?l.add(p.getItem()):bo.shouldNeverReachHere())}},Va.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},Va.prototype.getRoot=function(){return this.build(),this._root},Va.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],A=arguments[2],i=this.removeItem(r,A);if(i)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 Fa&&(i=this.remove(n,a,A)))){o=a;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),i}},Va.prototype.createHigherLevels=function(t,e){bo.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},Va.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 Fa){var r=this.depth(n);r>t&&(t=r)}}return t+1}},Va.prototype.createParentBoundables=function(t,e){var n=this;bo.isTrue(!t.isEmpty());var r=new Ho;r.add(this.createNode(e));var A=new Ho(t);Ua.sort(A,this.getComparator());for(var i=A.iterator();i.hasNext();){var o=i.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(o)}return r},Va.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Va.prototype.interfaces_=function(){return[qi]},Va.prototype.getClass=function(){return Va},Va.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},za.IntersectsOp.get=function(){return qa},za.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},za.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Va,za);var qa=function(){},Ya=function(){};Ya.prototype.distance=function(t,e){},Ya.prototype.interfaces_=function(){return[]},Ya.prototype.getClass=function(){return Ya};var ja=function(t){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,t.call(this,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(t,e){bo.isTrue(t.length>0);for(var n=new Ho,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},e.prototype.createNode=function(t){return new Ha(t)},e.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.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)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),A=t.iterator(),i=0;i<e;i++){r[i]=new Ho;for(var o=0;A.hasNext()&&o<n;){var s=A.next();r[i].add(s),o++}}return r},e.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(Ki(arguments[2],ka)&&arguments[0]instanceof Object&&arguments[1]instanceof Fa){var A=arguments[0],i=arguments[1],o=arguments[2];t.prototype.query.call(this,A,i,o)}else if(Ki(arguments[2],Yo)&&arguments[0]instanceof Object&&arguments[1]instanceof Fa){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},e.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)},e.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(t,n){bo.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),A=new Ho(t);Ua.sort(A,e.xComparator);var i=this.verticalSlices(A,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(i,n)},e.prototype.nearestNeighbour=function(){if(1===arguments.length){if(Ki(arguments[0],Ya)){var t=arguments[0],n=new Qa(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(n)}if(arguments[0]instanceof Qa){var r=arguments[0];return this.nearestNeighbour(r,Gi.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof e&&Ki(arguments[1],Ya)){var A=arguments[0],i=arguments[1],o=new Qa(this.getRoot(),A.getRoot(),i);return this.nearestNeighbour(o)}if(arguments[0]instanceof Qa&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,c=new Pa;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 Ra(arguments[0],arguments[1]),d=new Qa(this.getRoot(),p,h);return this.nearestNeighbour(d)[0]}},e.prototype.interfaces_=function(){return[Ba,qi]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return Ha},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[zi]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[zi]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(Va),Ha=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 ho(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fa),Xa=function(){};Xa.prototype.interfaces_=function(){return[]},Xa.prototype.getClass=function(){return Xa},Xa.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Xa.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=Xa.relativeSign(e.x,n.x),A=Xa.relativeSign(e.y,n.y);switch(t){case 0:return Xa.compareValue(r,A);case 1:return Xa.compareValue(A,r);case 2:return Xa.compareValue(A,-r);case 3:return Xa.compareValue(-r,A);case 4:return Xa.compareValue(-r,-A);case 5:return Xa.compareValue(-A,-r);case 6:return Xa.compareValue(-A,r);case 7:return Xa.compareValue(r,-A)}return bo.shouldNeverReachHere("invalid octant value"),0},Xa.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var $a=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 Yi(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};$a.prototype.getCoordinate=function(){return this.coord},$a.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},$a.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Xa.compare(this._segmentOctant,this.coord,e.coord)},$a.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},$a.prototype.isInterior=function(){return this._isInterior},$a.prototype.interfaces_=function(){return[Qi]},$a.prototype.getClass=function(){return $a};var Wa=function(){this._nodeMap=new ls,this._edge=null;var t=arguments[0];this._edge=t};Wa.prototype.getSplitCoordinates=function(){var t=new $o;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()},Wa.prototype.addCollapsedNodes=function(){var t=new Ho;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)}},Wa.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Wa.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 eo(e+1))}},Wa.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);n.add(new Yi(t.coord),!1);for(var i=t.segmentIndex+1;i<=e.segmentIndex;i++)n.add(this._edge.getCoordinate(i));A&&n.add(new Yi(e.coord))},Wa.prototype.iterator=function(){return this._nodeMap.values().iterator()},Wa.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},Wa.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)},Wa.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var A=n.next();this.findCollapseIndex(r,A,e)&&t.add(new eo(e[0])),r=A}},Wa.prototype.getEdge=function(){return this._edge},Wa.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Wa.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new Yi(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this._edge.getCoordinate(s);return A&&(i[o]=new Yi(e.coord)),new tu(i,this._edge.getData())},Wa.prototype.add=function(t,e){var n=new $a(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(bo.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},Wa.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Eo("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),A=r[r.length-1];if(!A.equals2D(e[e.length-1]))throw new Eo("bad split edge end point at "+A)},Wa.prototype.interfaces_=function(){return[]},Wa.prototype.getClass=function(){return Wa};var Ka=function(){};Ka.prototype.interfaces_=function(){return[]},Ka.prototype.getClass=function(){return Ka},Ka.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 Fi("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 Yi&&arguments[1]instanceof Yi){var A=arguments[0],i=arguments[1],o=i.x-A.x,s=i.y-A.y;if(0===o&&0===s)throw new Fi("Cannot compute the octant for two identical points "+A);return Ka.octant(o,s)}};var Za=function(){};Za.prototype.getCoordinates=function(){},Za.prototype.size=function(){},Za.prototype.getCoordinate=function(t){},Za.prototype.isClosed=function(){},Za.prototype.setData=function(t){},Za.prototype.getData=function(){},Za.prototype.interfaces_=function(){return[]},Za.prototype.getClass=function(){return Za};var Ja=function(){};Ja.prototype.addIntersection=function(t,e){},Ja.prototype.interfaces_=function(){return[Za]},Ja.prototype.getClass=function(){return Ja};var tu=function(){this._nodeList=new Wa(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};tu.prototype.getCoordinates=function(){return this._pts},tu.prototype.size=function(){return this._pts.length},tu.prototype.getCoordinate=function(t){return this._pts[t]},tu.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},tu.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},tu.prototype.setData=function(t){this._data=t},tu.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Ka.octant(t,e)},tu.prototype.getData=function(){return this._data},tu.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],A=new Yi(arguments[0].getIntersection(r));this.addIntersection(A,n)}},tu.prototype.toString=function(){return vo.toLineString(new Hs(this._pts))},tu.prototype.getNodeList=function(){return this._nodeList},tu.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var A=this._pts[r];t.equals2D(A)&&(n=r)}return this._nodeList.add(t,n)},tu.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},tu.prototype.interfaces_=function(){return[Ja]},tu.prototype.getClass=function(){return tu},tu.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Ho;return tu.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 eu=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new Yi,this.p1=new Yi;else if(1===arguments.length){var t=arguments[0];this.p0=new Yi(t.p0),this.p1=new Yi(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],A=arguments[3];this.p0=new Yi(e,n),this.p1=new Yi(r,A)}},nu={serialVersionUID:{configurable:!0}};eu.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},eu.prototype.orientationIndex=function(){if(arguments[0]instanceof eu){var t=arguments[0],e=Do.orientationIndex(this.p0,this.p1,t.p0),n=Do.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 Yi){var r=arguments[0];return Do.orientationIndex(this.p0,this.p1,r)}},eu.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},eu.prototype.isVertical=function(){return this.p0.x===this.p1.x},eu.prototype.equals=function(t){if(!(t instanceof eu))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},eu.prototype.intersection=function(t){var e=new xo;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},eu.prototype.project=function(){if(arguments[0]instanceof Yi){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Yi(t);var e=this.projectionFactor(t),n=new Yi;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 eu){var r=arguments[0],A=this.projectionFactor(r.p0),i=this.projectionFactor(r.p1);if(A>=1&&i>=1)return null;if(A<=0&&i<=0)return null;var o=this.project(r.p0);A<0&&(o=this.p0),A>1&&(o=this.p1);var s=this.project(r.p1);return i<0&&(s=this.p0),i>1&&(s=this.p1),new eu(o,s)}},eu.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},eu.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},eu.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},eu.prototype.distancePerpendicular=function(t){return Do.distancePointLinePerpendicular(t,this.p0,this.p1)},eu.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},eu.prototype.midPoint=function(){return eu.midPoint(this.p0,this.p1)},eu.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?Gi.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},eu.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=Gi.MAX_VALUE,A=null,i=this.closestPoint(t.p0);r=i.distance(t.p0),n[0]=i,n[1]=t.p0;var o=this.closestPoint(t.p1);(A=o.distance(t.p1))<r&&(r=A,n[0]=o,n[1]=t.p1);var s=t.closestPoint(this.p0);(A=s.distance(this.p0))<r&&(r=A,n[0]=this.p0,n[1]=s);var a=t.closestPoint(this.p1);return(A=a.distance(this.p1))<r&&(r=A,n[0]=this.p1,n[1]=a),n},eu.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},eu.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},eu.prototype.getLength=function(){return this.p0.distance(this.p1)},eu.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},eu.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},eu.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)},eu.prototype.lineIntersection=function(t){try{return fo.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof co))throw t}return null},eu.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},eu.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),A=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,o=Math.sqrt(A*A+i*i),s=0,a=0;if(0!==e){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*A/o,a=e*i/o}return new Yi(n-a,r+s)},eu.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}},eu.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Gi.isNaN(e))&&(e=1),e},eu.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},eu.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},eu.prototype.distance=function(){if(arguments[0]instanceof eu){var t=arguments[0];return Do.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof Yi){var e=arguments[0];return Do.distancePointLine(e,this.p0,this.p1)}},eu.prototype.pointAlong=function(t){var e=new Yi;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},eu.prototype.hashCode=function(){var t=Gi.doubleToLongBits(this.p0.x);t^=31*Gi.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=Gi.doubleToLongBits(this.p1.x);return n^=31*Gi.doubleToLongBits(this.p1.y),e^(Math.trunc(n)^Math.trunc(n>>32))},eu.prototype.interfaces_=function(){return[Qi,qi]},eu.prototype.getClass=function(){return eu},eu.midPoint=function(t,e){return new Yi((t.x+e.x)/2,(t.y+e.y)/2)},nu.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(eu,nu);var ru=function(){this.tempEnv1=new ho,this.tempEnv2=new ho,this._overlapSeg1=new eu,this._overlapSeg2=new eu};ru.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)}},ru.prototype.interfaces_=function(){return[]},ru.prototype.getClass=function(){return ru};var Au=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};Au.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Au.prototype.computeSelect=function(t,e,n,r){var A=this._pts[e],i=this._pts[n];if(r.tempEnv1.init(A,i),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)},Au.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},Au.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Au.prototype.setId=function(t){this._id=t},Au.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Au.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ho(t,e)}return this._env},Au.prototype.getEndIndex=function(){return this._end},Au.prototype.getStartIndex=function(){return this._start},Au.prototype.getContext=function(){return this._context},Au.prototype.getId=function(){return this._id},Au.prototype.computeOverlapsInternal=function(t,e,n,r,A,i){var o=this._pts[t],s=this._pts[e],a=n._pts[r],u=n._pts[A];if(e-t==1&&A-r==1)return i.overlap(this,t,n,r),null;if(i.tempEnv1.init(o,s),i.tempEnv2.init(a,u),!i.tempEnv1.intersects(i.tempEnv2))return null;var c=Math.trunc((t+e)/2),l=Math.trunc((r+A)/2);t<c&&(r<l&&this.computeOverlapsInternal(t,c,n,r,l,i),l<A&&this.computeOverlapsInternal(t,c,n,l,A,i)),c<e&&(r<l&&this.computeOverlapsInternal(c,e,n,r,l,i),l<A&&this.computeOverlapsInternal(c,e,n,l,A,i))},Au.prototype.interfaces_=function(){return[]},Au.prototype.getClass=function(){return Au};var iu=function(){};iu.prototype.interfaces_=function(){return[]},iu.prototype.getClass=function(){return iu},iu.getChainStartIndices=function(t){var e=0,n=new Ho;n.add(new eo(e));do{var r=iu.findChainEnd(t,e);n.add(new eo(r)),e=r}while(e<t.length-1);return iu.toIntArray(n)},iu.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=xa.quadrant(t[n],t[n+1]),A=e+1;A<t.length;){if(!t[A-1].equals2D(t[A]))if(xa.quadrant(t[A-1],t[A])!==r)break;A++}return A-1},iu.getChains=function(){if(1===arguments.length)return iu.getChains(arguments[0],null);if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=new Ho,r=iu.getChainStartIndices(t),A=0;A<r.length-1;A++){var i=new Au(t,r[A],r[A+1],e);n.add(i)}return n}},iu.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 ou=function(){};ou.prototype.computeNodes=function(t){},ou.prototype.getNodedSubstrings=function(){},ou.prototype.interfaces_=function(){return[]},ou.prototype.getClass=function(){return ou};var su=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};su.prototype.setSegmentIntersector=function(t){this._segInt=t},su.prototype.interfaces_=function(){return[ou]},su.prototype.getClass=function(){return su};var au=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Ho,this._index=new ja,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return tu.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=this,n=iu.getChains(t.getCoordinates(),t).iterator();n.hasNext();){var r=n.next();r.setId(e._idCounter++),e._index.insert(r.getEnvelope(),r),e._monoChains.add(r)}},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=this,e=new uu(this._segInt),n=this._monoChains.iterator();n.hasNext();)for(var r=n.next(),A=t._index.query(r.getEnvelope()).iterator();A.hasNext();){var i=A.next();if(i.getId()>r.getId()&&(r.computeOverlaps(i,e),t._nOverlaps++),t._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return uu},Object.defineProperties(e,n),e}(su),uu=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],A=arguments[0].getContext(),i=n.getContext();this._si.processIntersections(A,e,i,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ru),cu=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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(A),this.setEndCapStyle(i),this.setJoinStyle(o),this.setMitreLimit(s)}},lu={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}};cu.prototype.getEndCapStyle=function(){return this._endCapStyle},cu.prototype.isSingleSided=function(){return this._isSingleSided},cu.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=cu.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=cu.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==cu.JOIN_ROUND&&(this._quadrantSegments=cu.DEFAULT_QUADRANT_SEGMENTS)},cu.prototype.getJoinStyle=function(){return this._joinStyle},cu.prototype.setJoinStyle=function(t){this._joinStyle=t},cu.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},cu.prototype.getSimplifyFactor=function(){return this._simplifyFactor},cu.prototype.getQuadrantSegments=function(){return this._quadrantSegments},cu.prototype.setEndCapStyle=function(t){this._endCapStyle=t},cu.prototype.getMitreLimit=function(){return this._mitreLimit},cu.prototype.setMitreLimit=function(t){this._mitreLimit=t},cu.prototype.setSingleSided=function(t){this._isSingleSided=t},cu.prototype.interfaces_=function(){return[]},cu.prototype.getClass=function(){return cu},cu.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},lu.CAP_ROUND.get=function(){return 1},lu.CAP_FLAT.get=function(){return 2},lu.CAP_SQUARE.get=function(){return 3},lu.JOIN_ROUND.get=function(){return 1},lu.JOIN_MITRE.get=function(){return 2},lu.JOIN_BEVEL.get=function(){return 3},lu.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},lu.DEFAULT_MITRE_LIMIT.get=function(){return 5},lu.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(cu,lu);var fu=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Do.COUNTERCLOCKWISE,this._inputLine=t||null},hu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};fu.prototype.isDeletable=function(t,e,n,r){var A=this._inputLine[t],i=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(A,i,o)&&(!!this.isShallow(A,i,o,r)&&this.isShallowSampled(A,i,t,n,r))},fu.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),A=!1;r<this._inputLine.length;){var i=!1;t.isDeletable(e,n,r,t._distanceTol)&&(t._isDeleted[n]=fu.DELETE,i=!0,A=!0),e=i?r:n,n=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(n)}return A},fu.prototype.isShallowConcavity=function(t,e,n,r){return Do.computeOrientation(t,e,n)===this._angleOrientation&&Do.distancePointLine(e,t,n)<r},fu.prototype.isShallowSampled=function(t,e,n,r,A){var i=Math.trunc((r-n)/fu.NUM_PTS_TO_CHECK);i<=0&&(i=1);for(var o=n;o<r;o+=i)if(!this.isShallow(t,e,this._inputLine[o],A))return!1;return!0},fu.prototype.isConcave=function(t,e,n){var r=Do.computeOrientation(t,e,n)===this._angleOrientation;return r},fu.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=Do.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},fu.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===fu.DELETE;)e++;return e},fu.prototype.isShallow=function(t,e,n,r){return Do.distancePointLine(e,t,n)<r},fu.prototype.collapseLine=function(){for(var t=new $o,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==fu.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},fu.prototype.interfaces_=function(){return[]},fu.prototype.getClass=function(){return fu},fu.simplify=function(t,e){return new fu(t).simplify(e)},hu.INIT.get=function(){return 0},hu.DELETE.get=function(){return 1},hu.KEEP.get=function(){return 1},hu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(fu,hu);var pu=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Ho},du={COORDINATE_ARRAY_TYPE:{configurable:!0}};pu.prototype.getCoordinates=function(){return this._ptList.toArray(pu.COORDINATE_ARRAY_TYPE)},pu.prototype.setPrecisionModel=function(t){this._precisionModel=t},pu.prototype.addPt=function(t){var e=new Yi(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},pu.prototype.revere=function(){},pu.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])},pu.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},pu.prototype.toString=function(){return(new na).createLineString(this.getCoordinates()).toString()},pu.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new Yi(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},pu.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},pu.prototype.interfaces_=function(){return[]},pu.prototype.getClass=function(){return pu},du.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(pu,du);var gu=function(){},yu={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu},gu.toDegrees=function(t){return 180*t/Math.PI},gu.normalize=function(t){for(;t>Math.PI;)t-=gu.PI_TIMES_2;for(;t<=-Math.PI;)t+=gu.PI_TIMES_2;return t},gu.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,A=n.y-e.y;return Math.atan2(A,r)}},gu.isAcute=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)>0},gu.isObtuse=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)<0},gu.interiorAngle=function(t,e,n){var r=gu.angle(e,t),A=gu.angle(e,n);return Math.abs(A-r)},gu.normalizePositive=function(t){if(t<0){for(;t<0;)t+=gu.PI_TIMES_2;t>=gu.PI_TIMES_2&&(t=0)}else{for(;t>=gu.PI_TIMES_2;)t-=gu.PI_TIMES_2;t<0&&(t=0)}return t},gu.angleBetween=function(t,e,n){var r=gu.angle(e,t),A=gu.angle(e,n);return gu.diff(r,A)},gu.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},gu.toRadians=function(t){return t*Math.PI/180},gu.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?gu.COUNTERCLOCKWISE:n<0?gu.CLOCKWISE:gu.NONE},gu.angleBetweenOriented=function(t,e,n){var r=gu.angle(e,t),A=gu.angle(e,n)-r;return A<=-Math.PI?A+gu.PI_TIMES_2:A>Math.PI?A-gu.PI_TIMES_2:A},yu.PI_TIMES_2.get=function(){return 2*Math.PI},yu.PI_OVER_2.get=function(){return Math.PI/2},yu.PI_OVER_4.get=function(){return Math.PI/4},yu.COUNTERCLOCKWISE.get=function(){return Do.COUNTERCLOCKWISE},yu.CLOCKWISE.get=function(){return Do.CLOCKWISE},yu.NONE.get=function(){return Do.COLLINEAR},Object.defineProperties(gu,yu);var _u=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 eu,this._seg1=new eu,this._offset0=new eu,this._offset1=new eu,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 xo,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===cu.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},mu={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}};_u.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=Do.computeOrientation(this._s0,this._s1,this._s2),r=n===Do.CLOCKWISE&&this._side===ca.LEFT||n===Do.COUNTERCLOCKWISE&&this._side===ca.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},_u.prototype.addLineEndCap=function(t,e){var n=new eu(t,e),r=new eu;this.computeOffsetSegment(n,ca.LEFT,this._distance,r);var A=new eu;this.computeOffsetSegment(n,ca.RIGHT,this._distance,A);var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i);switch(this._bufParams.getEndCapStyle()){case cu.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,Do.CLOCKWISE,this._distance),this._segList.addPt(A.p1);break;case cu.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(A.p1);break;case cu.CAP_SQUARE:var a=new Yi;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new Yi(r.p1.x+a.x,r.p1.y+a.y),c=new Yi(A.p1.x+a.x,A.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(c)}},_u.prototype.getCoordinates=function(){return this._segList.getCoordinates()},_u.prototype.addMitreJoin=function(t,e,n,r){var A=!0,i=null;try{i=fo.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:i.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(A=!1)}catch(t){if(!(t instanceof co))throw t;i=new Yi(0,0),A=!1}A?this._segList.addPt(i):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},_u.prototype.addFilletCorner=function(t,e,n,r,A){var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i),a=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,a);r===Do.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,A),this._segList.addPt(n)},_u.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*_u.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===cu.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===cu.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))},_u.prototype.createSquare=function(t){this._segList.addPt(new Yi(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new Yi(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new Yi(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new Yi(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},_u.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},_u.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},_u.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},_u.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)},_u.prototype.addLimitedMitreJoin=function(t,e,n,r){var A=this._seg0.p1,i=gu.angle(A,this._seg0.p0),o=gu.angleBetweenOriented(this._seg0.p0,A,this._seg1.p1)/2,s=gu.normalize(i+o),a=gu.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(o)),l=A.x+u*Math.cos(a),f=A.y+u*Math.sin(a),h=new Yi(l,f),p=new eu(A,h),d=p.pointAlongOffset(1,c),g=p.pointAlongOffset(1,-c);this._side===ca.LEFT?(this._segList.addPt(d),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(d))},_u.prototype.computeOffsetSegment=function(t,e,n,r){var A=e===ca.LEFT?1:-1,i=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,s=Math.sqrt(i*i+o*o),a=A*n*i/s,u=A*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},_u.prototype.addFilletArc=function(t,e,n,r,A){var i=r===Do.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 Yi;u<o;){var l=e+i*u;c.x=t.x+A*Math.cos(l),c.y=t.y+A*Math.sin(l),this._segList.addPt(c),u+=a}},_u.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*_u.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 Yi((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 Yi((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)}},_u.prototype.createCircle=function(t){var e=new Yi(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},_u.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},_u.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new pu,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*_u.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},_u.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===cu.JOIN_BEVEL||this._bufParams.getJoinStyle()===cu.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,Do.CLOCKWISE,this._distance))},_u.prototype.closeRing=function(){this._segList.closeRing()},_u.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},_u.prototype.interfaces_=function(){return[]},_u.prototype.getClass=function(){return _u},mu.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},mu.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},mu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},mu.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(_u,mu);var vu=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};vu.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),A=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],A):this.computeOffsetCurve(t,n,A);var i=A.getCoordinates();return n&&Wo.reverse(i),i},vu.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var A=fu.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],ca.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{n.addSegments(t,!1);var s=fu.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],ca.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},vu.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===ca.RIGHT&&(r=-r);var A=fu.simplify(t,r),i=A.length-1;n.initSideSegments(A[i-1],A[0],e);for(var o=1;o<=i;o++){var s=1!==o;n.addNextSegment(A[o],s)}n.closeRing()},vu.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=fu.simplify(t,n),A=r.length-1;e.initSideSegments(r[0],r[1],ca.LEFT);for(var i=2;i<=A;i++)e.addNextSegment(r[i],!0);e.addLastSegment(),e.addLineEndCap(r[A-1],r[A]);var o=fu.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],ca.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},vu.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case cu.CAP_ROUND:e.createCircle(t);break;case cu.CAP_SQUARE:e.createSquare(t)}},vu.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 A=e<0;this.computeSingleSidedBufferCurve(t,A,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},vu.prototype.getBufferParameters=function(){return this._bufParams},vu.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},vu.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return vu.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},vu.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var A=fu.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],ca.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{var s=fu.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],ca.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},vu.prototype.getSegGen=function(t){return new _u(this._precisionModel,this._bufParams,t)},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu},vu.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new Yi(t[n]);return e};var Eu=function(){this._subgraphs=null,this._seg=new eu,this._cga=new Do;var t=arguments[0];this._subgraphs=t},wu={DepthSegment:{configurable:!0}};Eu.prototype.findStabbedSegments=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],n=new Ho,r=this._subgraphs.iterator();r.hasNext();){var A=r.next(),i=A.getEnvelope();e.y<i.getMinY()||e.y>i.getMaxY()||t.findStabbedSegments(e,A.getDirectedEdges(),n)}return n}if(3===arguments.length)if(Ki(arguments[2],Yo)&&arguments[0]instanceof Yi&&arguments[1]instanceof Da)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++){if(t._seg.p0=u[c],t._seg.p1=u[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse(),!(Math.max(t._seg.p0.x,t._seg.p1.x)<o.x||t._seg.isHorizontal()||o.y<t._seg.p0.y||o.y>t._seg.p1.y||Do.computeOrientation(t._seg.p0,t._seg.p1,o)===Do.RIGHT)){var l=s.getDepth(ca.LEFT);t._seg.p0.equals(u[c])||(l=s.getDepth(ca.RIGHT));var f=new bu(t._seg,l);a.add(f)}}else if(Ki(arguments[2],Yo)&&arguments[0]instanceof Yi&&Ki(arguments[1],Yo))for(var h=arguments[0],p=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&t.findStabbedSegments(h,g,p)}},Eu.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Ua.min(e)._leftDepth},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu},wu.DepthSegment.get=function(){return bu},Object.defineProperties(Eu,wu);var bu=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new eu(t),this._leftDepth=e};bu.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)},bu.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},bu.prototype.toString=function(){return this._upwardSeg.toString()},bu.prototype.interfaces_=function(){return[Qi]},bu.prototype.getClass=function(){return bu};var Iu=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Iu.prototype.area=function(){return Iu.area(this.p0,this.p1,this.p2)},Iu.prototype.signedArea=function(){return Iu.signedArea(this.p0,this.p1,this.p2)},Iu.prototype.interpolateZ=function(t){if(null===t)throw new Fi("Supplied point is null.");return Iu.interpolateZ(t,this.p0,this.p1,this.p2)},Iu.prototype.longestSideLength=function(){return Iu.longestSideLength(this.p0,this.p1,this.p2)},Iu.prototype.isAcute=function(){return Iu.isAcute(this.p0,this.p1,this.p2)},Iu.prototype.circumcentre=function(){return Iu.circumcentre(this.p0,this.p1,this.p2)},Iu.prototype.area3D=function(){return Iu.area3D(this.p0,this.p1,this.p2)},Iu.prototype.centroid=function(){return Iu.centroid(this.p0,this.p1,this.p2)},Iu.prototype.inCentre=function(){return Iu.inCentre(this.p0,this.p1,this.p2)},Iu.prototype.interfaces_=function(){return[]},Iu.prototype.getClass=function(){return Iu},Iu.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)},Iu.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Iu.det=function(t,e,n,r){return t*r-e*n},Iu.interpolateZ=function(t,e,n,r){var A=e.x,i=e.y,o=n.x-A,s=r.x-A,a=n.y-i,u=r.y-i,c=o*u-s*a,l=t.x-A,f=t.y-i,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)},Iu.longestSideLength=function(t,e,n){var r=t.distance(e),A=e.distance(n),i=n.distance(t),o=r;return A>o&&(o=A),i>o&&(o=i),o},Iu.isAcute=function(t,e,n){return!!gu.isAcute(t,e,n)&&(!!gu.isAcute(e,n,t)&&!!gu.isAcute(n,t,e))},Iu.circumcentre=function(t,e,n){var r=n.x,A=n.y,i=t.x-r,o=t.y-A,s=e.x-r,a=e.y-A,u=2*Iu.det(i,o,s,a),c=Iu.det(o,i*i+o*o,a,s*s+a*a),l=Iu.det(i,i*i+o*o,s,s*s+a*a);return new Yi(r-c/u,A+l/u)},Iu.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,A=new fo(t.x+n/2,t.y+r/2,1),i=new fo(t.x-r+n/2,t.y+n+r/2,1);return new fo(A,i)},Iu.angleBisector=function(t,e,n){var r=e.distance(t),A=r/(r+e.distance(n)),i=n.x-t.x,o=n.y-t.y;return new Yi(t.x+A*i,t.y+A*o)},Iu.area3D=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=e.z-t.z,o=n.x-t.x,s=n.y-t.y,a=n.z-t.z,u=A*a-i*s,c=i*o-r*a,l=r*s-A*o,f=u*u+c*c+l*l,h=Math.sqrt(f)/2;return h},Iu.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,A=(t.y+e.y+n.y)/3;return new Yi(r,A)},Iu.inCentre=function(t,e,n){var r=e.distance(n),A=t.distance(n),i=t.distance(e),o=r+A+i,s=(r*t.x+A*e.x+i*n.x)/o,a=(r*t.y+A*e.y+i*n.y)/o;return new Yi(s,a)};var Cu=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Ho;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Cu.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,$i.EXTERIOR,$i.INTERIOR)},Cu.prototype.addPolygon=function(t){var e=this,n=this._distance,r=ca.LEFT;this._distance<0&&(n=-this._distance,r=ca.RIGHT);var A=t.getExteriorRing(),i=Wo.removeRepeatedPoints(A.getCoordinates());if(this._distance<0&&this.isErodedCompletely(A,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,n,r,$i.EXTERIOR,$i.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Wo.removeRepeatedPoints(s.getCoordinates());e._distance>0&&e.isErodedCompletely(s,-e._distance)||e.addPolygonRing(a,n,ca.opposite(r),$i.INTERIOR,$i.EXTERIOR)}},Cu.prototype.isTriangleErodedCompletely=function(t,e){var n=new Iu(t[0],t[1],t[2]),r=n.inCentre();return Do.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Cu.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Wo.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,$i.EXTERIOR,$i.INTERIOR)},Cu.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new tu(t,new ma(0,$i.BOUNDARY,e,n));this._curveList.add(r)},Cu.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Cu.prototype.addPolygonRing=function(t,e,n,r,A){if(0===e&&t.length<Us.MINIMUM_VALID_SIZE)return null;var i=r,o=A;t.length>=Us.MINIMUM_VALID_SIZE&&Do.isCCW(t)&&(i=A,o=r,n=ca.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,i,o)},Cu.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Fs?this.addPolygon(t):t instanceof Rs?this.addLineString(t):t instanceof ks?this.addPoint(t):(t instanceof Gs||t instanceof ws||t instanceof Qs||t instanceof Es)&&this.addCollection(t)},Cu.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(),A=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>A},Cu.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Cu.prototype.interfaces_=function(){return[]},Cu.prototype.getClass=function(){return Cu};var xu=function(){};xu.prototype.locate=function(t){},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu};var Nu=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()};Nu.prototype.next=function(){if(this._atStart)return this._atStart=!1,Nu.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 jo;var t=this._parent.getGeometryN(this._index++);return t instanceof Es?(this._subcollectionIterator=new Nu(t),this._subcollectionIterator.next()):t},Nu.prototype.remove=function(){throw new Error(this.getClass().getName())},Nu.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)},Nu.prototype.interfaces_=function(){return[qo]},Nu.prototype.getClass=function(){return Nu},Nu.isAtomic=function(t){return!(t instanceof Es)};var Su=function(){this._geom=null;var t=arguments[0];this._geom=t};Su.prototype.locate=function(t){return Su.locate(t,this._geom)},Su.prototype.interfaces_=function(){return[xu]},Su.prototype.getClass=function(){return Su},Su.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Do.isPointInRing(t,e.getCoordinates())},Su.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Su.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var A=e.getInteriorRingN(r);if(Su.isPointInRing(t,A))return!1}return!0},Su.containsPoint=function(t,e){if(e instanceof Fs)return Su.containsPointInPolygon(t,e);if(e instanceof Es)for(var n=new Nu(e);n.hasNext();){var r=n.next();if(r!==e&&Su.containsPoint(t,r))return!0}return!1},Su.locate=function(t,e){return e.isEmpty()?$i.EXTERIOR:Su.containsPoint(t,e)?$i.INTERIOR:$i.EXTERIOR};var Du=function(){this._edgeMap=new ls,this._edgeList=null,this._ptInAreaLocation=[$i.NONE,$i.NONE]};Du.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)},Du.prototype.propagateSideLabels=function(t){for(var e=$i.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,ca.LEFT)!==$i.NONE&&(e=r.getLocation(t,ca.LEFT))}if(e===$i.NONE)return null;for(var A=e,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();if(s.getLocation(t,ca.ON)===$i.NONE&&s.setLocation(t,ca.ON,A),s.isArea(t)){var a=s.getLocation(t,ca.LEFT),u=s.getLocation(t,ca.RIGHT);if(u!==$i.NONE){if(u!==A)throw new da("side location conflict",o.getCoordinate());a===$i.NONE&&bo.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),A=a}else bo.isTrue(s.getLocation(t,ca.LEFT)===$i.NONE,"found single null side"),s.setLocation(t,ca.RIGHT,A),s.setLocation(t,ca.LEFT,A)}}},Du.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Du.prototype.print=function(t){lo.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Du.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Du.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,ca.LEFT);bo.isTrue(r!==$i.NONE,"Found unlabelled area edge");for(var A=r,i=this.iterator();i.hasNext();){var o=i.next().getLabel();bo.isTrue(o.isArea(t),"Found non-area edge");var s=o.getLocation(t,ca.LEFT),a=o.getLocation(t,ca.RIGHT);if(s===a)return!1;if(a!==A)return!1;A=s}return!0},Du.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},Du.prototype.iterator=function(){return this.getEdges().iterator()},Du.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Ho(this._edgeMap.values())),this._edgeList},Du.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===$i.NONE&&(this._ptInAreaLocation[t]=Su.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Du.prototype.toString=function(){var t=new to;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()},Du.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){e.next().computeLabel(t)}},Du.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(),A=0;A<2;A++)r.isLine(A)&&r.getLocation(A)===$i.BOUNDARY&&(e[A]=!0);for(var i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)if(s.isAnyNull(a)){var u=$i.NONE;if(e[a])u=$i.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(a,c,t)}s.setAllLocationsIfNull(a,u)}},Du.prototype.getDegree=function(){return this._edgeMap.size()},Du.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Du.prototype.interfaces_=function(){return[]},Du.prototype.getClass=function(){return Du};var Lu=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(){var t=this;this.getResultAreaEdges();for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,A=0;A<this._resultAreaEdgeList.size();A++){var i=t._resultAreaEdgeList.get(A),o=i.getSym();if(i.getLabel().isArea())switch(null===e&&i.isInResult()&&(e=i),r){case t._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;n=o,r=t._LINKING_TO_OUTGOING;break;case t._LINKING_TO_OUTGOING:if(!i.isInResult())continue;n.setNext(i),r=t._SCANNING_FOR_INCOMING}}if(r===this._LINKING_TO_OUTGOING){if(null===e)throw new da("no outgoing dirEdge found",this.getCoordinate());bo.isTrue(e.isInResult(),"unable to link last incoming dirEdge"),n.setNext(e)}},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),A=n.getQuadrant(),i=r.getQuadrant();return xa.isNorthern(A)&&xa.isNorthern(i)?n:xa.isNorthern(A)||xa.isNorthern(i)?0!==n.getDy()?n:0!==r.getDy()?r:(bo.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){lo.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 Ho;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),A=r.getSym();null===e&&(e=A),null!==t&&A.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(ca.LEFT),r=t.getDepth(ca.RIGHT),A=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,A)!==r)throw new da("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var i=arguments[1],o=arguments[2],s=arguments[0];s<i;s++){var a=this._edgeList.get(s);a.setEdgeDepths(ca.RIGHT,o),o=a.getDepth(ca.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=this,n=null,r=null,A=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=e._resultAreaEdgeList.get(i),s=o.getSym();switch(null===n&&o.getEdgeRing()===t&&(n=o),A){case e._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;r=s,A=e._LINKING_TO_OUTGOING;break;case e._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),A=e._SCANNING_FOR_INCOMING}}A===this._LINKING_TO_OUTGOING&&(bo.isTrue(null!==n,"found null for first outgoing dirEdge"),bo.isTrue(n.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(n))},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,A=this.iterator();A.hasNext();){A.next().getEdgeRing()===n&&r++}return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=$i.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=$i.INTERIOR;break}if(r.isInResult()){t=$i.EXTERIOR;break}}}if(t===$i.NONE)return null;for(var A=t,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(A===$i.INTERIOR):(o.isInResult()&&(A=$i.EXTERIOR),s.isInResult()&&(A=$i.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new ma($i.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),A=0;A<2;A++){var i=r.getLocation(A);i!==$i.INTERIOR&&i!==$i.BOUNDARY||this._label.setLocation(A,$i.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Du),Tu=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 Ia(t,new Lu)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(La),Mu=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Mu.prototype.compareTo=function(t){var e=t;return Mu.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Mu.prototype.interfaces_=function(){return[Qi]},Mu.prototype.getClass=function(){return Mu},Mu.orientation=function(t){return 1===Wo.increasingDirection(t)},Mu.compareOriented=function(t,e,n,r){for(var A=e?1:-1,i=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+=A)===o,f=(u+=i)===s;if(l&&!f)return-1;if(!l&&f)return 1;if(l&&f)return 0}};var Ou=function(){this._edges=new Ho,this._ocaMap=new ls};Ou.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(),A=0;A<r.length;A++)A>0&&t.print(","),t.print(r[A].x+" "+r[A].y);t.println(")")}t.print(") ")},Ou.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Ou.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Ou.prototype.iterator=function(){return this._edges.iterator()},Ou.prototype.getEdges=function(){return this._edges},Ou.prototype.get=function(t){return this._edges.get(t)},Ou.prototype.findEqualEdge=function(t){var e=new Mu(t.getCoordinates());return this._ocaMap.get(e)},Ou.prototype.add=function(t){this._edges.add(t);var e=new Mu(t.getCoordinates());this._ocaMap.put(e,t)},Ou.prototype.interfaces_=function(){return[]},Ou.prototype.getClass=function(){return Ou};var Ru=function(){};Ru.prototype.processIntersections=function(t,e,n,r){},Ru.prototype.isDone=function(){},Ru.prototype.interfaces_=function(){return[]},Ru.prototype.getClass=function(){return Ru};var Pu=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};Pu.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Pu.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.size()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},Pu.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Pu.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Pu.prototype.getLineIntersector=function(){return this._li},Pu.prototype.hasProperIntersection=function(){return this._hasProper},Pu.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,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)))},Pu.prototype.hasIntersection=function(){return this._hasIntersection},Pu.prototype.isDone=function(){return!1},Pu.prototype.hasInteriorIntersection=function(){return this._hasInterior},Pu.prototype.interfaces_=function(){return[Ru]},Pu.prototype.getClass=function(){return Pu},Pu.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var ku=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new Yi(t),this.segmentIndex=e,this.dist=n};ku.prototype.getSegmentIndex=function(){return this.segmentIndex},ku.prototype.getCoordinate=function(){return this.coord},ku.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},ku.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},ku.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},ku.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},ku.prototype.getDistance=function(){return this.dist},ku.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},ku.prototype.interfaces_=function(){return[Qi]},ku.prototype.getClass=function(){return ku};var Bu=function(){this._nodeMap=new ls,this.edge=null;var t=arguments[0];this.edge=t};Bu.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Bu.prototype.iterator=function(){return this._nodeMap.values().iterator()},Bu.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},Bu.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)},Bu.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],A=e.dist>0||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new Yi(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this.edge.pts[s];return A&&(i[o]=e.coord),new Vu(i,new ma(this.edge._label))},Bu.prototype.add=function(t,e,n){var r=new ku(t,e,n),A=this._nodeMap.get(r);return null!==A?A:(this._nodeMap.put(r,r),r)},Bu.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},Bu.prototype.interfaces_=function(){return[]},Bu.prototype.getClass=function(){return Bu};var Fu=function(){};Fu.prototype.getChainStartIndices=function(t){var e=0,n=new Ho;n.add(new eo(e));do{var r=this.findChainEnd(t,e);n.add(new eo(r)),e=r}while(e<t.length-1);return Fu.toIntArray(n)},Fu.prototype.findChainEnd=function(t,e){for(var n=xa.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){if(xa.quadrant(t[r-1],t[r])!==n)break;r++}return r-1},Fu.prototype.interfaces_=function(){return[]},Fu.prototype.getClass=function(){return Fu},Fu.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 Gu=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ho,this.env2=new ho;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Fu;this.startIndex=e.getChainStartIndices(this.pts)};Gu.prototype.getCoordinates=function(){return this.pts},Gu.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},Gu.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},Gu.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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=arguments[5],c=this.pts[A],l=this.pts[i],f=o.pts[s],h=o.pts[a];if(i-A==1&&a-s==1)return u.addIntersections(this.e,A,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((A+i)/2),d=Math.trunc((s+a)/2);A<p&&(s<d&&this.computeIntersectsForChain(A,p,o,s,d,u),d<a&&this.computeIntersectsForChain(A,p,o,d,a,u)),p<i&&(s<d&&this.computeIntersectsForChain(p,i,o,s,d,u),d<a&&this.computeIntersectsForChain(p,i,o,d,a,u))}},Gu.prototype.getStartIndexes=function(){return this.startIndex},Gu.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)},Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu};var Uu=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},Qu={NULL_VALUE:{configurable:!0}};Uu.prototype.getDepth=function(t,e){return this._depth[t][e]},Uu.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},Uu.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]!==Uu.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===Uu.NULL_VALUE}if(2===arguments.length){var r=arguments[0],A=arguments[1];return this._depth[r][A]===Uu.NULL_VALUE}},Uu.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var r=1;r<3;r++){var A=0;t._depth[e][r]>n&&(A=1),t._depth[e][r]=A}}},Uu.prototype.getDelta=function(t){return this._depth[t][ca.RIGHT]-this._depth[t][ca.LEFT]},Uu.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?$i.EXTERIOR:$i.INTERIOR},Uu.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Uu.prototype.add=function(){var t=this;if(1===arguments.length)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var A=e.getLocation(n,r);A!==$i.EXTERIOR&&A!==$i.INTERIOR||(t.isNull(n,r)?t._depth[n][r]=Uu.depthAtLocation(A):t._depth[n][r]+=Uu.depthAtLocation(A))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===$i.INTERIOR&&this._depth[i][o]++}},Uu.prototype.interfaces_=function(){return[]},Uu.prototype.getClass=function(){return Uu},Uu.depthAtLocation=function(t){return t===$i.EXTERIOR?0:t===$i.INTERIOR?1:Uu.NULL_VALUE},Qu.NULL_VALUE.get=function(){return-1},Object.defineProperties(Uu,Qu);var Vu=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Bu(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Uu,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.pts=r,this._label=A}}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,ma.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,A=!0,i=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[--i])||(A=!1),!r&&!A)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 Gu(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new ho;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 A=new Yi(t.getIntersection(r)),i=e,o=t.getEdgeDistance(n,r),s=i+1;if(s<this.pts.length){var a=this.pts[s];A.equals2D(a)&&(i=s,o=0)}this.eiList.add(A,i,o)},e.prototype.toString=function(){var t=new to;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,ca.ON),e.getLocation(1,ca.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,ca.LEFT),e.getLocation(1,ca.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,ca.RIGHT),e.getLocation(1,ca.RIGHT),2))},e}(ba),zu=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ou,this._bufParams=t||null};zu.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},zu.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 ma(t.getLabel())).flip(),n.merge(r);var A=zu.depthDelta(r),i=e.getDepthDelta()+A;e.setDepthDelta(i)}else this._edgeList.add(t),t.setDepthDelta(zu.depthDelta(t.getLabel()))},zu.prototype.buildSubgraphs=function(t,e){for(var n=new Ho,r=t.iterator();r.hasNext();){var A=r.next(),i=A.getRightmostCoordinate(),o=new Eu(n).getDepth(i);A.computeDepth(o),A.findResultEdges(),n.add(A),e.add(A.getDirectedEdges(),A.getNodes())}},zu.prototype.createSubgraphs=function(t){for(var e=new Ho,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var A=new ya;A.create(r),e.add(A)}}return Ua.sort(e,Ua.reverseOrder()),e},zu.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},zu.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new au,n=new xo;return n.setPrecisionModel(t),e.setSegmentIntersector(new Pu(n)),e},zu.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new vu(n,this._bufParams),A=new Cu(t,e,r).getCurves();if(A.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(A,n),this._graph=new Ta(new Tu),this._graph.addEdges(this._edgeList.getEdges());var i=this.createSubgraphs(this._graph),o=new Ma(this._geomFact);this.buildSubgraphs(i,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},zu.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var A=r.next(),i=A.getCoordinates();if(2!==i.length||!i[0].equals2D(i[1])){var o=A.getData(),s=new Vu(A.getCoordinates(),new ma(o));this.insertUniqueEdge(s)}}},zu.prototype.setNoder=function(t){this._workingNoder=t},zu.prototype.interfaces_=function(){return[]},zu.prototype.getClass=function(){return zu},zu.depthDelta=function(t){var e=t.getLocation(0,ca.LEFT),n=t.getLocation(0,ca.RIGHT);return e===$i.INTERIOR&&n===$i.EXTERIOR?1:e===$i.EXTERIOR&&n===$i.INTERIOR?-1:0},zu.convertSegStrings=function(t){for(var e=new na,n=new Ho;t.hasNext();){var r=t.next(),A=e.createLineString(r.getCoordinates());n.add(A)}return e.buildGeometry(n)};var qu=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],A=arguments[2],i=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=A,this._offsetY=i,this._isScaled=!this.isIntegerPrecision()}};qu.prototype.rescale=function(){var t=this;if(Ki(arguments[0],Vo))for(var e=arguments[0].iterator();e.hasNext();){var n=e.next();t.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){for(var r=arguments[0],A=0;A<r.length;A++)r[A].x=r[A].x/t._scaleFactor+t._offsetX,r[A].y=r[A].y/t._scaleFactor+t._offsetY;2===r.length&&r[0].equals2D(r[1])&&lo.out.println(r)}},qu.prototype.scale=function(){var t=this;if(Ki(arguments[0],Vo)){for(var e=arguments[0],n=new Ho,r=e.iterator();r.hasNext();){var A=r.next();n.add(new tu(t.scale(A.getCoordinates()),A.getData()))}return n}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new Yi(Math.round((i[s].x-t._offsetX)*t._scaleFactor),Math.round((i[s].y-t._offsetY)*t._scaleFactor),i[s].z);return Wo.removeRepeatedPoints(o)}},qu.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},qu.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},qu.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},qu.prototype.interfaces_=function(){return[ou]},qu.prototype.getClass=function(){return qu};var Yu=function(){this._li=new xo,this._segStrings=null;var t=arguments[0];this._segStrings=t},ju={fact:{configurable:!0}};Yu.prototype.checkEndPtVertexIntersections=function(){var t=this;if(0===arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next().getCoordinates();t.checkEndPtVertexIntersections(n[0],t._segStrings),t.checkEndPtVertexIntersections(n[n.length-1],t._segStrings)}else if(2===arguments.length)for(var r=arguments[0],A=arguments[1].iterator();A.hasNext();)for(var i=A.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(r))throw new Eo("found endpt/interior pt intersection at index "+o+" :pt "+r)},Yu.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 A=arguments[0],i=arguments[1],o=A.getCoordinates(),s=i.getCoordinates(),a=0;a<o.length-1;a++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(A,a,i,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 Eo("found non-noded intersection at "+p+"-"+d+" and "+g+"-"+y)}},Yu.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Yu.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])},Yu.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var A=t.getIntersection(r);if(!A.equals(e)&&!A.equals(n))return!0}return!1},Yu.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Eo("found non-noded collapse at "+Yu.fact.createLineString([t,e,n]))},Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu},ju.fact.get=function(){return new na},Object.defineProperties(Yu,ju);var Hu=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 Fi("Scale factor must be non-zero");1!==e&&(this._pt=new Yi(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new Yi,this._p1Scaled=new Yi),this.initCorners(this._pt)},Xu={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Hu.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),A=Math.min(t.y,e.y),i=Math.max(t.y,e.y),o=this._maxx<n||this._minx>r||this._maxy<A||this._miny>i;if(o)return!1;var s=this.intersectsToleranceSquare(t,e);return bo.isTrue(!(o&&s),"Found bad envelope test"),s},Hu.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new Yi(this._maxx,this._maxy),this._corner[1]=new Yi(this._minx,this._maxy),this._corner[2]=new Yi(this._minx,this._miny),this._corner[3]=new Yi(this._maxx,this._miny)},Hu.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))},Hu.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Hu.prototype.getCoordinate=function(){return this._originalPt},Hu.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Hu.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=Hu.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ho(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Hu.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())))},Hu.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))))))},Hu.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)},Hu.prototype.interfaces_=function(){return[]},Hu.prototype.getClass=function(){return Hu},Xu.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Hu,Xu);var $u=function(){this.tempEnv1=new ho,this.selectedSegment=new eu};$u.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)}},$u.prototype.interfaces_=function(){return[]},$u.prototype.getClass=function(){return $u};var Wu=function(){this._index=null;var t=arguments[0];this._index=t},Ku={HotPixelSnapAction:{configurable:!0}};Wu.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],A=e.getSafeEnvelope(),i=new Zu(e,n,r);return this._index.query(A,{interfaces_:function(){return[ka]},visitItem:function(t){t.select(A,i)}}),i.isNodeAdded()}},Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu},Ku.HotPixelSnapAction.get=function(){return Zu},Object.defineProperties(Wu,Ku);var Zu=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}($u),Ju=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Ho};Ju.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(A,i,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)}},Ju.prototype.isDone=function(){return!1},Ju.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Ju.prototype.interfaces_=function(){return[Ru]},Ju.prototype.getClass=function(){return Ju};var tc=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 xo,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};tc.prototype.checkCorrectness=function(t){var e=tu.getNodedSubstrings(t),n=new Yu(e);try{n.checkValid()}catch(t){if(!(t instanceof uo))throw t;t.printStackTrace()}},tc.prototype.getNodedSubstrings=function(){return tu.getNodedSubstrings(this._nodedSegStrings)},tc.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},tc.prototype.findInteriorIntersections=function(t,e){var n=new Ju(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},tc.prototype.computeVertexSnaps=function(){var t=this;if(Ki(arguments[0],Vo))for(var e=arguments[0].iterator();e.hasNext();){var n=e.next();t.computeVertexSnaps(n)}else if(arguments[0]instanceof tu)for(var r=arguments[0],A=r.getCoordinates(),i=0;i<A.length;i++){var o=new Hu(A[i],t._scaleFactor,t._li);t._pointSnapper.snap(o,r,i)&&r.addIntersection(A[i],i)}},tc.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new au,this._pointSnapper=new Wu(this._noder.getIndex()),this.snapRound(t,this._li)},tc.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),A=new Hu(r,e._scaleFactor,e._li);e._pointSnapper.snap(A)}},tc.prototype.interfaces_=function(){return[ou]},tc.prototype.getClass=function(){return tc};var ec=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new cu,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}},nc={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};ec.prototype.bufferFixedPrecision=function(t){var e=new qu(new tc(new Zs(1)),t.getScale()),n=new zu(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},ec.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=ec.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof da))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=ec.precisionScaleFactor(this._argGeom,this._distance,n),A=new Zs(r);this.bufferFixedPrecision(A)}},ec.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Zs.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},ec.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},ec.prototype.bufferOriginalPrecision=function(){try{var t=new zu(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Eo))throw t;this._saveException=t}},ec.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},ec.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec},ec.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new ec(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Mo&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new ec(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof cu&&arguments[0]instanceof Mo&&"number"==typeof arguments[1]){var A=arguments[1];return new ec(arguments[0],arguments[2]).getResultGeometry(A)}}else if(4===arguments.length){var i=arguments[1],o=arguments[2],s=arguments[3],a=new ec(arguments[0]);return a.setQuadrantSegments(o),a.setEndCapStyle(s),a.getResultGeometry(i)}},ec.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),A=Zi.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),i=n-Math.trunc(Math.log(A)/Math.log(10)+1);return Math.pow(10,i)},nc.CAP_ROUND.get=function(){return cu.CAP_ROUND},nc.CAP_BUTT.get=function(){return cu.CAP_FLAT},nc.CAP_FLAT.get=function(){return cu.CAP_FLAT},nc.CAP_SQUARE.get=function(){return cu.CAP_SQUARE},nc.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(ec,nc);var rc=function(){this._pt=[new Yi,new Yi],this._distance=Gi.NaN,this._isNull=!0};rc.prototype.getCoordinates=function(){return this._pt},rc.prototype.getCoordinate=function(t){return this._pt[t]},rc.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)}},rc.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],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},rc.prototype.getDistance=function(){return this._distance},rc.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)}},rc.prototype.interfaces_=function(){return[]},rc.prototype.getClass=function(){return rc};var Ac=function(){};Ac.prototype.interfaces_=function(){return[]},Ac.prototype.getClass=function(){return Ac},Ac.computeDistance=function(){if(arguments[2]instanceof rc&&arguments[0]instanceof Rs&&arguments[1]instanceof Yi)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new eu,A=0;A<n.length-1;A++){r.setCoordinates(n[A],n[A+1]);var i=r.closestPoint(t);e.setMinimum(i,t)}else if(arguments[2]instanceof rc&&arguments[0]instanceof Fs&&arguments[1]instanceof Yi){var o=arguments[0],s=arguments[1],a=arguments[2];Ac.computeDistance(o.getExteriorRing(),s,a);for(var u=0;u<o.getNumInteriorRing();u++)Ac.computeDistance(o.getInteriorRingN(u),s,a)}else if(arguments[2]instanceof rc&&arguments[0]instanceof Mo&&arguments[1]instanceof Yi){var c=arguments[0],l=arguments[1],f=arguments[2];if(c instanceof Rs)Ac.computeDistance(c,l,f);else if(c instanceof Fs)Ac.computeDistance(c,l,f);else if(c instanceof Es)for(var h=c,p=0;p<h.getNumGeometries();p++){var d=h.getGeometryN(p);Ac.computeDistance(d,l,f)}else f.setMinimum(c.getCoordinate(),l)}else if(arguments[2]instanceof rc&&arguments[0]instanceof eu&&arguments[1]instanceof Yi){var g=arguments[1],y=arguments[2],_=arguments[0].closestPoint(g);y.setMinimum(_,g)}};var ic=function(t){this._maxPtDist=new rc,this._inputGeom=t||null},oc={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};ic.prototype.computeMaxMidpointDistance=function(t){var e=new ac(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ic.prototype.computeMaxVertexDistance=function(t){var e=new sc(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ic.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},ic.prototype.getDistancePoints=function(){return this._maxPtDist},ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic},oc.MaxPointDistanceFilter.get=function(){return sc},oc.MaxMidpointDistanceFilter.get=function(){return ac},Object.defineProperties(ic,oc);var sc=function(t){this._maxPtDist=new rc,this._minPtDist=new rc,this._geom=t||null};sc.prototype.filter=function(t){this._minPtDist.initialize(),Ac.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},sc.prototype.getMaxPointDistance=function(){return this._maxPtDist},sc.prototype.interfaces_=function(){return[Po]},sc.prototype.getClass=function(){return sc};var ac=function(t){this._maxPtDist=new rc,this._minPtDist=new rc,this._geom=t||null};ac.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),A=new Yi((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),Ac.computeDistance(this._geom,A,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ac.prototype.isDone=function(){return!1},ac.prototype.isGeometryChanged=function(){return!1},ac.prototype.getMaxPointDistance=function(){return this._maxPtDist},ac.prototype.interfaces_=function(){return[vs]},ac.prototype.getClass=function(){return ac};var uc=function(t){this._comps=t||null};uc.prototype.filter=function(t){t instanceof Fs&&this._comps.add(t)},uc.prototype.interfaces_=function(){return[ms]},uc.prototype.getClass=function(){return uc},uc.getPolygons=function(){if(1===arguments.length)return uc.getPolygons(arguments[0],new Ho);if(2===arguments.length){var t=arguments[0],e=arguments[1];return t instanceof Fs?e.add(t):t instanceof Es&&t.apply(new uc(e)),e}};var cc=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}};cc.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Us){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Rs&&this._lines.add(t)},cc.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},cc.prototype.interfaces_=function(){return[To]},cc.prototype.getClass=function(){return cc},cc.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(cc.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(cc.getLines(e,n))}},cc.getLines=function(){if(1===arguments.length)return cc.getLines(arguments[0],!1);if(2===arguments.length){if(Ki(arguments[0],Vo)&&Ki(arguments[1],Vo)){for(var t=arguments[1],e=arguments[0].iterator();e.hasNext();){var n=e.next();cc.getLines(n,t)}return t}if(arguments[0]instanceof Mo&&"boolean"==typeof arguments[1]){var r=arguments[0],A=arguments[1],i=new Ho;return r.apply(new cc(i,A)),i}if(arguments[0]instanceof Mo&&Ki(arguments[1],Vo)){var o=arguments[0],s=arguments[1];return o instanceof Rs?s.add(o):o.apply(new cc(s)),s}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&Ki(arguments[0],Vo)&&Ki(arguments[1],Vo)){for(var a=arguments[1],u=arguments[2],c=arguments[0].iterator();c.hasNext();){var l=c.next();cc.getLines(l,a,u)}return a}if("boolean"==typeof arguments[2]&&arguments[0]instanceof Mo&&Ki(arguments[1],Vo)){var f=arguments[1],h=arguments[2];return arguments[0].apply(new cc(f,h)),f}}};var lc=function(){if(this._boundaryRule=ko.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 Fi("Rule must be non-null");this._boundaryRule=t}};lc.prototype.locateInternal=function(){if(arguments[0]instanceof Yi&&arguments[1]instanceof Fs){var t=arguments[0],e=arguments[1];if(e.isEmpty())return $i.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===$i.EXTERIOR)return $i.EXTERIOR;if(r===$i.BOUNDARY)return $i.BOUNDARY;for(var A=0;A<e.getNumInteriorRing();A++){var i=e.getInteriorRingN(A),o=this.locateInPolygonRing(t,i);if(o===$i.INTERIOR)return $i.EXTERIOR;if(o===$i.BOUNDARY)return $i.BOUNDARY}return $i.INTERIOR}if(arguments[0]instanceof Yi&&arguments[1]instanceof Rs){var s=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(s))return $i.EXTERIOR;var u=a.getCoordinates();return a.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?Do.isOnLine(s,u)?$i.INTERIOR:$i.EXTERIOR:$i.BOUNDARY}if(arguments[0]instanceof Yi&&arguments[1]instanceof ks){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?$i.INTERIOR:$i.EXTERIOR}},lc.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?Do.locatePointInRing(t,e.getCoordinates()):$i.EXTERIOR},lc.prototype.intersects=function(t,e){return this.locate(t,e)!==$i.EXTERIOR},lc.prototype.updateLocationInfo=function(t){t===$i.INTERIOR&&(this._isIn=!0),t===$i.BOUNDARY&&this._numBoundaries++},lc.prototype.computeLocation=function(t,e){var n=this;if(e instanceof ks&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Rs)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fs)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof ws)for(var r=e,A=0;A<r.getNumGeometries();A++){var i=r.getGeometryN(A);n.updateLocationInfo(n.locateInternal(t,i))}else if(e instanceof Qs)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);n.updateLocationInfo(n.locateInternal(t,a))}else if(e instanceof Es)for(var u=new Nu(e);u.hasNext();){var c=u.next();c!==e&&n.computeLocation(t,c)}},lc.prototype.locate=function(t,e){return e.isEmpty()?$i.EXTERIOR:e instanceof Rs||e instanceof Fs?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?$i.BOUNDARY:this._numBoundaries>0||this._isIn?$i.INTERIOR:$i.EXTERIOR)},lc.prototype.interfaces_=function(){return[]},lc.prototype.getClass=function(){return lc};var fc=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}},hc={INSIDE_AREA:{configurable:!0}};fc.prototype.isInsideArea=function(){return this._segIndex===fc.INSIDE_AREA},fc.prototype.getCoordinate=function(){return this._pt},fc.prototype.getGeometryComponent=function(){return this._component},fc.prototype.getSegmentIndex=function(){return this._segIndex},fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc},hc.INSIDE_AREA.get=function(){return-1},Object.defineProperties(fc,hc);var pc=function(t){this._pts=t||null};pc.prototype.filter=function(t){t instanceof ks&&this._pts.add(t)},pc.prototype.interfaces_=function(){return[ms]},pc.prototype.getClass=function(){return pc},pc.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof ks?Ua.singletonList(t):pc.getPoints(t,new Ho)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof ks?n.add(e):e instanceof Es&&e.apply(new pc(n)),n}};var dc=function(){this._locations=null;var t=arguments[0];this._locations=t};dc.prototype.filter=function(t){(t instanceof ks||t instanceof Rs||t instanceof Fs)&&this._locations.add(new fc(t,0,t.getCoordinate()))},dc.prototype.interfaces_=function(){return[ms]},dc.prototype.getClass=function(){return dc},dc.getLocations=function(t){var e=new Ho;return t.apply(new dc(e)),e};var gc=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new lc,this._minDistanceLocation=null,this._minDistance=Gi.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],A=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=A}};gc.prototype.computeContainmentDistance=function(){var t=this;if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1],A=1-n,i=uc.getPolygons(this._geom[n]);if(i.size()>0){var o=dc.getLocations(this._geom[A]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[A]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Ki(arguments[0],Yo)&&Ki(arguments[1],Yo)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),f=0;f<a.size();f++)if(t.computeContainmentDistance(l,a.get(f),u),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof fc&&arguments[1]instanceof Fs){var h=arguments[0],p=arguments[1],d=arguments[2],g=h.getCoordinate();if($i.EXTERIOR!==this._ptLocator.locate(g,p))return this._minDistance=0,d[0]=h,d[1]=new fc(p,g),null}},gc.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=this,A=0;A<t.size();A++)for(var i=t.get(A),o=0;o<e.size();o++){var s=e.get(o);if(r.computeMinDistance(i,s,n),r._minDistance<=r._terminateDistance)return null}},gc.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=cc.getLines(this._geom[0]),n=cc.getLines(this._geom[1]),r=pc.getPoints(this._geom[0]),A=pc.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,A,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,A,t),void this.updateMinDistance(t,!1))))},gc.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},gc.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])},gc.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},gc.prototype.computeMinDistance=function(){var t=this;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 Rs&&arguments[1]instanceof ks){var e=arguments[0],n=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var A=e.getCoordinates(),i=n.getCoordinate(),o=0;o<A.length-1;o++){var s=Do.distancePointLine(i,A[o],A[o+1]);if(s<t._minDistance){t._minDistance=s;var a=new eu(A[o],A[o+1]).closestPoint(i);r[0]=new fc(e,o,a),r[1]=new fc(n,0,i)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Rs&&arguments[1]instanceof Rs){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var f=u.getCoordinates(),h=c.getCoordinates(),p=0;p<f.length-1;p++)for(var d=0;d<h.length-1;d++){var g=Do.distanceLineLine(f[p],f[p+1],h[d],h[d+1]);if(g<t._minDistance){t._minDistance=g;var y=new eu(f[p],f[p+1]),_=new eu(h[d],h[d+1]),m=y.closestPoints(_);l[0]=new fc(u,p,m[0]),l[1]=new fc(c,d,m[1])}if(t._minDistance<=t._terminateDistance)return null}}},gc.prototype.computeMinDistancePoints=function(t,e,n){for(var r=this,A=0;A<t.size();A++)for(var i=t.get(A),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<r._minDistance&&(r._minDistance=a,n[0]=new fc(i,0,i.getCoordinate()),n[1]=new fc(s,0,s.getCoordinate())),r._minDistance<=r._terminateDistance)return null}},gc.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new Fi("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},gc.prototype.computeMinDistanceLines=function(t,e,n){for(var r=this,A=0;A<t.size();A++)for(var i=t.get(A),o=0;o<e.size();o++){var s=e.get(o);if(r.computeMinDistance(i,s,n),r._minDistance<=r._terminateDistance)return null}},gc.prototype.interfaces_=function(){return[]},gc.prototype.getClass=function(){return gc},gc.distance=function(t,e){return new gc(t,e).distance()},gc.isWithinDistance=function(t,e,n){return new gc(t,e,n).distance()<=n},gc.nearestPoints=function(t,e){return new gc(t,e).nearestPoints()};var yc=function(){this._pt=[new Yi,new Yi],this._distance=Gi.NaN,this._isNull=!0};yc.prototype.getCoordinates=function(){return this._pt},yc.prototype.getCoordinate=function(t){return this._pt[t]},yc.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)}},yc.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],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},yc.prototype.toString=function(){return vo.toLineString(this._pt[0],this._pt[1])},yc.prototype.getDistance=function(){return this._distance},yc.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)}},yc.prototype.interfaces_=function(){return[]},yc.prototype.getClass=function(){return yc};var _c=function(){};_c.prototype.interfaces_=function(){return[]},_c.prototype.getClass=function(){return _c},_c.computeDistance=function(){if(arguments[2]instanceof yc&&arguments[0]instanceof Rs&&arguments[1]instanceof Yi)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new eu,A=t.getCoordinates(),i=0;i<A.length-1;i++){r.setCoordinates(A[i],A[i+1]);var o=r.closestPoint(e);n.setMinimum(o,e)}else if(arguments[2]instanceof yc&&arguments[0]instanceof Fs&&arguments[1]instanceof Yi){var s=arguments[0],a=arguments[1],u=arguments[2];_c.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)_c.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof yc&&arguments[0]instanceof Mo&&arguments[1]instanceof Yi){var l=arguments[0],f=arguments[1],h=arguments[2];if(l instanceof Rs)_c.computeDistance(l,f,h);else if(l instanceof Fs)_c.computeDistance(l,f,h);else if(l instanceof Es)for(var p=l,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);_c.computeDistance(g,f,h)}else h.setMinimum(l.getCoordinate(),f)}else if(arguments[2]instanceof yc&&arguments[0]instanceof eu&&arguments[1]instanceof Yi){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var mc=function(){this._g0=null,this._g1=null,this._ptDist=new yc,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},vc={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};mc.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},mc.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new Fi("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},mc.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},mc.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},mc.prototype.computeOrientedDistance=function(t,e,n){var r=new Ec(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var A=new wc(e,this._densifyFrac);t.apply(A),n.setMaximum(A.getMaxPointDistance())}},mc.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},mc.prototype.interfaces_=function(){return[]},mc.prototype.getClass=function(){return mc},mc.distance=function(){if(2===arguments.length)return new mc(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new mc(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},vc.MaxPointDistanceFilter.get=function(){return Ec},vc.MaxDensifiedByFractionDistanceFilter.get=function(){return wc},Object.defineProperties(mc,vc);var Ec=function(){this._maxPtDist=new yc,this._minPtDist=new yc,this._euclideanDist=new _c,this._geom=null;var t=arguments[0];this._geom=t};Ec.prototype.filter=function(t){this._minPtDist.initialize(),_c.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ec.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ec.prototype.interfaces_=function(){return[Po]},Ec.prototype.getClass=function(){return Ec};var wc=function(){this._maxPtDist=new yc,this._minPtDist=new yc,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};wc.prototype.filter=function(t,e){var n=this;if(0===e)return null;for(var r=t.getCoordinate(e-1),A=t.getCoordinate(e),i=(A.x-r.x)/this._numSubSegs,o=(A.y-r.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=r.x+s*i,u=r.y+s*o,c=new Yi(a,u);n._minPtDist.initialize(),_c.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},wc.prototype.isDone=function(){return!1},wc.prototype.isGeometryChanged=function(){return!1},wc.prototype.getMaxPointDistance=function(){return this._maxPtDist},wc.prototype.interfaces_=function(){return[vs]},wc.prototype.getClass=function(){return wc};var bc=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},Ic={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};bc.prototype.checkMaximumDistance=function(t,e,n){var r=new mc(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var A=r.getCoordinates();this._errorLocation=A[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+vo.toLineString(A[0],A[1])+")"}},bc.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=bc.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(),bc.VERBOSE&&lo.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},bc.prototype.checkNegativeValid=function(){if(!(this._input instanceof Fs||this._input instanceof Qs||this._input instanceof Es))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)},bc.prototype.getErrorIndicator=function(){return this._errorIndicator},bc.prototype.checkMinimumDistance=function(t,e,n){var r=new gc(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var A=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+vo.toLineString(A[0],A[1])+" )"}},bc.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)},bc.prototype.getErrorLocation=function(){return this._errorLocation},bc.prototype.getPolygonLines=function(t){for(var e=new Ho,n=new cc(e),r=uc.getPolygons(t).iterator();r.hasNext();){r.next().apply(n)}return t.getFactory().buildGeometry(e)},bc.prototype.getErrorMessage=function(){return this._errMsg},bc.prototype.interfaces_=function(){return[]},bc.prototype.getClass=function(){return bc},Ic.VERBOSE.get=function(){return!1},Ic.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(bc,Ic);var Cc=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},xc={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Cc.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},Cc.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Cc.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new ho(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new ho(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")},Cc.prototype.checkDistance=function(){var t=new bc(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")},Cc.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")},Cc.prototype.checkPolygonal=function(){this._result instanceof Fs||this._result instanceof Qs||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Cc.prototype.getErrorIndicator=function(){return this._errorIndicator},Cc.prototype.getErrorLocation=function(){return this._errorLocation},Cc.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"))},Cc.prototype.report=function(t){if(!Cc.VERBOSE)return null;lo.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Cc.prototype.getErrorMessage=function(){return this._errorMsg},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc},Cc.isValidMsg=function(t,e,n){var r=new Cc(t,e,n);return r.isValid()?null:r.getErrorMessage()},Cc.isValid=function(t,e,n){return!!new Cc(t,e,n).isValid()},xc.VERBOSE.get=function(){return!1},xc.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Cc,xc);var Nc=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Nc.prototype.getCoordinates=function(){return this._pts},Nc.prototype.size=function(){return this._pts.length},Nc.prototype.getCoordinate=function(t){return this._pts[t]},Nc.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Nc.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Ka.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Nc.prototype.setData=function(t){this._data=t},Nc.prototype.getData=function(){return this._data},Nc.prototype.toString=function(){return vo.toLineString(new Hs(this._pts))},Nc.prototype.interfaces_=function(){return[Za]},Nc.prototype.getClass=function(){return Nc};var Sc=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Ho,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Sc.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Sc.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Sc.prototype.getIntersectionSegments=function(){return this._intSegments},Sc.prototype.count=function(){return this._intersectionCount},Sc.prototype.getIntersections=function(){return this._intersections},Sc.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Sc.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Sc.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 A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=A,this._intSegments[1]=i,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Sc.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Sc.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Sc.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Sc.prototype.interfaces_=function(){return[Ru]},Sc.prototype.getClass=function(){return Sc},Sc.createAllIntersectionsFinder=function(t){var e=new Sc(t);return e.setFindAllIntersections(!0),e},Sc.createAnyIntersectionFinder=function(t){return new Sc(t)},Sc.createIntersectionCounter=function(t){var e=new Sc(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Dc=function(){this._li=new xo,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Dc.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Dc.prototype.getIntersections=function(){return this._segInt.getIntersections()},Dc.prototype.isValid=function(){return this.execute(),this._isValid},Dc.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Dc.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Sc(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new au;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Dc.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new da(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Dc.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+vo.toLineString(t[0],t[1])+" and "+vo.toLineString(t[2],t[3])},Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Dc.computeIntersections=function(t){var e=new Dc(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Lc=function t(){this._nv=null;var e=arguments[0];this._nv=new Dc(t.toSegmentStrings(e))};Lc.prototype.checkValid=function(){this._nv.checkValid()},Lc.prototype.interfaces_=function(){return[]},Lc.prototype.getClass=function(){return Lc},Lc.toSegmentStrings=function(t){for(var e=new Ho,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Nc(r.getCoordinates(),r))}return e},Lc.checkValid=function(t){new Lc(t).checkValid()};var Tc=function(t){this._mapOp=t};Tc.prototype.map=function(t){for(var e=new Ho,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(na.toGeometryArray(e))},Tc.prototype.interfaces_=function(){return[]},Tc.prototype.getClass=function(){return Tc},Tc.map=function(t,e){return new Tc(e).map(t)};var Mc=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Ho,this._resultLineList=new Ho;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Mc.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var r=n.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}},Mc.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Mc.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Mc.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),A=t.getEdge();t.isLineEdge()&&(t.isVisited()||!fl.isResultOfOp(r,e)||A.isCovered()||(n.add(A),t.setVisitedEdge(!0)))},Mc.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 A=this._op.isCoveredByA(n.getCoordinate());r.setCovered(A)}}},Mc.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))}},Mc.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)}},Mc.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(bo.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(fl.isResultOfOp(r,e)&&e===fl.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Mc.prototype.interfaces_=function(){return[]},Mc.prototype.getClass=function(){return Mc};var Oc=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Ho;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Oc.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Oc.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===fl.INTERSECTION))){var r=n.getLabel();fl.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Oc.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Oc.prototype.interfaces_=function(){return[]},Oc.prototype.getClass=function(){return Oc};var Rc=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Rc.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Rc.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof Us&&!r.isEmpty()||(n=!1);for(var A=new Ho,i=0;i<t.getNumInteriorRing();i++){var o=this.transformLinearRing(t.getInteriorRingN(i),t);null===o||o.isEmpty()||(o instanceof Us||(n=!1),A.add(o))}if(n)return this._factory.createPolygon(r,A.toArray([]));var s=new Ho;return null!==r&&s.add(r),s.addAll(A),this._factory.buildGeometry(s)},Rc.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Rc.prototype.getInputGeometry=function(){return this._inputGeom},Rc.prototype.transformMultiLineString=function(t,e){for(var n=new Ho,r=0;r<t.getNumGeometries();r++){var A=this.transformLineString(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Rc.prototype.transformCoordinates=function(t,e){return this.copy(t)},Rc.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Rc.prototype.transformMultiPoint=function(t,e){for(var n=new Ho,r=0;r<t.getNumGeometries();r++){var A=this.transformPoint(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Rc.prototype.transformMultiPolygon=function(t,e){for(var n=new Ho,r=0;r<t.getNumGeometries();r++){var A=this.transformPolygon(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Rc.prototype.copy=function(t){return t.copy()},Rc.prototype.transformGeometryCollection=function(t,e){for(var n=new Ho,r=0;r<t.getNumGeometries();r++){var A=this.transform(t.getGeometryN(r));null!==A&&(this._pruneEmptyGeometry&&A.isEmpty()||n.add(A))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(na.toGeometryArray(n)):this._factory.buildGeometry(n)},Rc.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ks)return this.transformPoint(t,null);if(t instanceof Gs)return this.transformMultiPoint(t,null);if(t instanceof Us)return this.transformLinearRing(t,null);if(t instanceof Rs)return this.transformLineString(t,null);if(t instanceof ws)return this.transformMultiLineString(t,null);if(t instanceof Fs)return this.transformPolygon(t,null);if(t instanceof Qs)return this.transformMultiPolygon(t,null);if(t instanceof Es)return this.transformGeometryCollection(t,null);throw new Fi("Unknown Geometry subtype: "+t.getClass().getName())},Rc.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)},Rc.prototype.interfaces_=function(){return[]},Rc.prototype.getClass=function(){return Rc};var Pc=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new eu,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Rs&&"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}};Pc.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var A=t.get(r),i=this.findSnapForVertex(A,e);null!==i&&(t.set(r,new Yi(i)),0===r&&this._isClosed&&t.set(t.size()-1,new Yi(i)))}},Pc.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},Pc.prototype.snapTo=function(t){var e=new $o(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Pc.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 A=e[r],i=this.findSegmentIndexToSnap(A,t);i>=0&&t.add(i+1,new Yi(A),!1)}},Pc.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=Gi.MAX_VALUE,A=-1,i=0;i<e.size()-1;i++){if(n._seg.p0=e.get(i),n._seg.p1=e.get(i+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var o=n._seg.distance(t);o<n._snapTolerance&&o<r&&(r=o,A=i)}return A},Pc.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Pc.prototype.interfaces_=function(){return[]},Pc.prototype.getClass=function(){return Pc},Pc.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var kc=function(t){this._srcGeom=t||null},Bc={SNAP_PRECISION_FACTOR:{configurable:!0}};kc.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Fc(e,n).transform(this._srcGeom)},kc.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Fc(t,n,!0).transform(this._srcGeom),A=r;return e&&Ki(A,Bs)&&(A=r.buffer(0)),A},kc.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},kc.prototype.extractTargetCoordinates=function(t){for(var e=new ps,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},kc.prototype.computeMinimumSegmentLength=function(t){for(var e=Gi.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},kc.prototype.interfaces_=function(){return[]},kc.prototype.getClass=function(){return kc},kc.snap=function(t,e,n){var r=new Array(2).fill(null),A=new kc(t);r[0]=A.snapTo(e,n);var i=new kc(e);return r[1]=i.snapTo(r[0],n),r},kc.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=kc.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Zs.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var A=arguments[0],i=arguments[1];return Math.min(kc.computeOverlaySnapTolerance(A),kc.computeOverlaySnapTolerance(i))}},kc.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*kc.SNAP_PRECISION_FACTOR},kc.snapToSelf=function(t,e,n){return new kc(t).snapToSelf(e,n)},Bc.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(kc,Bc);var Fc=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 Pc(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}(Rc),Gc=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Gc.prototype.getCommon=function(){return Gi.longBitsToDouble(this._commonBits)},Gc.prototype.add=function(t){var e=Gi.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Gc.signExpBits(this._commonBits),this._isFirst=!1,null):Gc.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Gc.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Gc.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Gc.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=Gi.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+Gi.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Gc.prototype.interfaces_=function(){return[]},Gc.prototype.getClass=function(){return Gc},Gc.getBit=function(t,e){return t&1<<e?1:0},Gc.signExpBits=function(t){return t>>52},Gc.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Gc.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Gc.getBit(t,r)!==Gc.getBit(e,r))return n;n++}return 52};var Uc=function(){this._commonCoord=null,this._ccFilter=new Vc},Qc={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Uc.prototype.addCommonBits=function(t){var e=new zc(this._commonCoord);t.apply(e),t.geometryChanged()},Uc.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new Yi(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new zc(e);return t.apply(n),t.geometryChanged(),t},Uc.prototype.getCommonCoordinate=function(){return this._commonCoord},Uc.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Uc.prototype.interfaces_=function(){return[]},Uc.prototype.getClass=function(){return Uc},Qc.CommonCoordinateFilter.get=function(){return Vc},Qc.Translater.get=function(){return zc},Object.defineProperties(Uc,Qc);var Vc=function(){this._commonBitsX=new Gc,this._commonBitsY=new Gc};Vc.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Vc.prototype.getCommonCoordinate=function(){return new Yi(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Vc.prototype.interfaces_=function(){return[Po]},Vc.prototype.getClass=function(){return Vc};var zc=function(){this.trans=null;var t=arguments[0];this.trans=t};zc.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)},zc.prototype.isDone=function(){return!1},zc.prototype.isGeometryChanged=function(){return!0},zc.prototype.interfaces_=function(){return[vs]},zc.prototype.getClass=function(){return zc};var qc=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()};qc.prototype.selfSnap=function(t){return new kc(t).snapTo(t,this._snapTolerance)},qc.prototype.removeCommonBits=function(t){this._cbr=new Uc,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},qc.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},qc.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=fl.overlayOp(e[0],e[1],t);return this.prepareResult(n)},qc.prototype.checkValid=function(t){t.isValid()||lo.out.println("Snapped geometry is invalid")},qc.prototype.computeSnapTolerance=function(){this._snapTolerance=kc.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},qc.prototype.snap=function(t){var e=this.removeCommonBits(t);return kc.snap(e[0],e[1],this._snapTolerance)},qc.prototype.interfaces_=function(){return[]},qc.prototype.getClass=function(){return qc},qc.overlayOp=function(t,e,n){return new qc(t,e).getResultGeometry(n)},qc.union=function(t,e){return qc.overlayOp(t,e,fl.UNION)},qc.intersection=function(t,e){return qc.overlayOp(t,e,fl.INTERSECTION)},qc.symDifference=function(t,e){return qc.overlayOp(t,e,fl.SYMDIFFERENCE)},qc.difference=function(t,e){return qc.overlayOp(t,e,fl.DIFFERENCE)};var Yc=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Yc.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=fl.overlayOp(this._geom[0],this._geom[1],t);n=!0}catch(t){if(!(t instanceof Eo))throw t;r=t}if(!n)try{e=qc.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Eo?r:t}return e},Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc},Yc.overlayOp=function(t,e,n){return new Yc(t,e).getResultGeometry(n)},Yc.union=function(t,e){return Yc.overlayOp(t,e,fl.UNION)},Yc.intersection=function(t,e){return Yc.overlayOp(t,e,fl.INTERSECTION)},Yc.symDifference=function(t,e){return Yc.overlayOp(t,e,fl.SYMDIFFERENCE)},Yc.difference=function(t,e){return Yc.overlayOp(t,e,fl.DIFFERENCE)};var jc=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};jc.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},jc.prototype.interfaces_=function(){return[]},jc.prototype.getClass=function(){return jc};var Hc=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],A=arguments[1],i=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=A,this._obj=i}},Xc={INSERT:{configurable:!0},DELETE:{configurable:!0}};Hc.prototype.isDelete=function(){return this._eventType===Hc.DELETE},Hc.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Hc.prototype.getObject=function(){return this._obj},Hc.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},Hc.prototype.getInsertEvent=function(){return this._insertEvent},Hc.prototype.isInsert=function(){return this._eventType===Hc.INSERT},Hc.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Hc.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Hc.prototype.interfaces_=function(){return[Qi]},Hc.prototype.getClass=function(){return Hc},Xc.INSERT.get=function(){return 1},Xc.DELETE.get=function(){return 2},Object.defineProperties(Hc,Xc);var $c=function(){};$c.prototype.interfaces_=function(){return[]},$c.prototype.getClass=function(){return $c};var Wc=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};Wc.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Wc.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.getNumPoints()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},Wc.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Wc.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Wc.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Wc.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},Wc.prototype.hasProperIntersection=function(){return this._hasProper},Wc.prototype.hasIntersection=function(){return this._hasIntersection},Wc.prototype.isDone=function(){return this._isDone},Wc.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},Wc.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Wc.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,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))))},Wc.prototype.interfaces_=function(){return[]},Wc.prototype.getClass=function(){return Wc},Wc.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kc=function(t){function e(){t.call(this),this.events=new Ho,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Ua.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 Wc&&Ki(arguments[0],Yo)&&Ki(arguments[1],Yo)){var r=arguments[0],A=arguments[1],i=arguments[2];this.addEdges(r,r),this.addEdges(A,A),this.computeIntersections(i)}else if("boolean"==typeof arguments[2]&&Ki(arguments[0],Yo)&&arguments[1]instanceof Wc){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(),A=0;A<r.length-1;A++){var i=new jc(n,A),o=new Hc(e,n.getMinX(A),i);this.events.add(o),this.events.add(new Hc(n.getMaxX(A),o))}},e.prototype.processOverlaps=function(t,e,n,r){for(var A=n.getObject(),i=t;i<e;i++){var o=this.events.get(i);if(o.isInsert()){var s=o.getObject();n.isSameLabel(o)||(A.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 A=r.next();this.addEdge(A,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($c),Zc=function(){this._min=Gi.POSITIVE_INFINITY,this._max=Gi.NEGATIVE_INFINITY},Jc={NodeComparator:{configurable:!0}};Zc.prototype.getMin=function(){return this._min},Zc.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Zc.prototype.getMax=function(){return this._max},Zc.prototype.toString=function(){return vo.toLineString(new Yi(this._min,0),new Yi(this._max,0))},Zc.prototype.interfaces_=function(){return[]},Zc.prototype.getClass=function(){return Zc},Jc.NodeComparator.get=function(){return tl},Object.defineProperties(Zc,Jc);var tl=function(){};tl.prototype.compare=function(t,e){var n=t,r=e,A=(n._min+n._max)/2,i=(r._min+r._max)/2;return A<i?-1:A>i?1:0},tl.prototype.interfaces_=function(){return[zi]},tl.prototype.getClass=function(){return tl};var el=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}(Zc),nl=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}(Zc),rl=function(){this._leaves=new Ho,this._root=null,this._level=0};rl.prototype.buildTree=function(){Ua.sort(this._leaves,new Zc.NodeComparator);for(var t=this._leaves,e=null,n=new Ho;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},rl.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 el(t,e,n))},rl.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},rl.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},rl.prototype.printNode=function(t){lo.out.println(vo.toLineString(new Yi(t._min,this._level),new Yi(t._max,this._level)))},rl.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},rl.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 A=new nl(t.get(n),t.get(n+1));e.add(A)}}},rl.prototype.interfaces_=function(){return[]},rl.prototype.getClass=function(){return rl};var Al=function(){this._items=new Ho};Al.prototype.visitItem=function(t){this._items.add(t)},Al.prototype.getItems=function(){return this._items},Al.prototype.interfaces_=function(){return[ka]},Al.prototype.getClass=function(){return Al};var il=function(){this._index=null;var t=arguments[0];if(!Ki(t,Bs))throw new Fi("Argument must be Polygonal");this._index=new al(t)},ol={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};il.prototype.locate=function(t){var e=new So(t),n=new sl(e);return this._index.query(t.y,t.y,n),e.getLocation()},il.prototype.interfaces_=function(){return[xu]},il.prototype.getClass=function(){return il},ol.SegmentVisitor.get=function(){return sl},ol.IntervalIndexedGeometry.get=function(){return al},Object.defineProperties(il,ol);var sl=function(){this._counter=null;var t=arguments[0];this._counter=t};sl.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},sl.prototype.interfaces_=function(){return[ka]},sl.prototype.getClass=function(){return sl};var al=function(){this._index=new rl;var t=arguments[0];this.init(t)};al.prototype.init=function(t){for(var e=cc.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},al.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new eu(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),A=Math.max(n.p0.y,n.p1.y);this._index.insert(r,A,n)}},al.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Al;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];this._index.query(r,A,i)}},al.prototype.interfaces_=function(){return[]},al.prototype.getClass=function(){return al};var ul=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new Ks,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new lc,2===arguments.length){var e=arguments[0],n=arguments[1],r=ko.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];this._argIndex=A,this._parentGeom=i,this._boundaryNodeRule=o,null!==i&&this.add(i)}}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(),A=1;r.getLocation(t,ca.ON)===$i.BOUNDARY&&A++;var i=e.determineBoundary(this._boundaryNodeRule,A);r.setLocation(t,i)},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],A=new Wc(arguments[0],!0,!1);A.setIsDoneIfProperInt(r);var i=this.createEdgeSetIntersector(),o=this._parentGeom instanceof Us||this._parentGeom instanceof Fs||this._parentGeom instanceof Qs,s=n||!o;return i.computeIntersections(this._edges,A,s),this.addSelfIntersectionNodes(this._argIndex),A}},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 Wc(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 ks){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,$i.INTERIOR)}else if(arguments[0]instanceof Yi){var e=arguments[0];this.insertPoint(this._argIndex,e,$i.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),$i.EXTERIOR,$i.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,$i.INTERIOR,$i.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],$i.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],$i.BOUNDARY)},e.prototype.addLineString=function(t){var e=Wo.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new Vu(e,new ma(this._argIndex,$i.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),bo.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 A=r.next();e[n++]=A.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===$i.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=Wo.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var A=e,i=n;Do.isCCW(r)&&(A=n,i=e);var o=new Vu(r,new ma(this._argIndex,$i.BOUNDARY,A,i));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],$i.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),A=r.getLabel();null===A?r._label=new ma(t,n):A.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new Kc},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),A=n.eiList.iterator();A.hasNext();){var i=A.next();this.addSelfIntersectionNode(t,i.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 Qs&&(this._useBoundaryDeterminationRule=!1),e instanceof Fs)this.addPolygon(e);else if(e instanceof Rs)this.addLineString(e);else if(e instanceof ks)this.addPoint(e);else if(e instanceof Gs)this.addCollection(e);else if(e instanceof ws)this.addCollection(e);else if(e instanceof Qs)this.addCollection(e);else{if(!(e instanceof Es))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 Ki(this._parentGeom,Bs)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new il(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)?$i.BOUNDARY:$i.INTERIOR},e}(Ta),cl=function(){if(this._li=new xo,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 ul(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=ko.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 ul(0,e,r),this._arg[1]=new ul(1,n,r)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];A.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(A.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ul(0,A,o),this._arg[1]=new ul(1,i,o)}};cl.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},cl.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl};var ll=function(){};ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll},ll.map=function(){if(arguments[0]instanceof Mo&&Ki(arguments[1],ll.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Ho,r=0;r<t.getNumGeometries();r++){var A=e.map(t.getGeometryN(r));null!==A&&n.add(A)}return t.getFactory().buildGeometry(n)}if(Ki(arguments[0],Vo)&&Ki(arguments[1],ll.MapOp)){for(var i=arguments[0],o=arguments[1],s=new Ho,a=i.iterator();a.hasNext();){var u=a.next(),c=o.map(u);null!==c&&s.add(c)}return s}},ll.MapOp=function(){};var fl=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new lc,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ou,this._resultPolyList=new Ho,this._resultLineList=new Ho,this._resultPointList=new Ho,this._graph=new Ta(new Tu),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 ma(t.getLabel())).flip();var A=e.getDepth();A.isNull()&&A.add(n),A.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,A){var i=new Ho;return i.addAll(t),i.addAll(n),i.addAll(r),i.isEmpty()?e.createEmptyResult(A,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(i)},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)!==$i.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Ho,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 Ho;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Lc.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ma(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Mc(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var A=new Oc(this,this._geomFact,this._ptLocator);this._resultPointList=A.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(),A=r.getLabel();A.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(A.getLocation(0,ca.RIGHT),A.getLocation(1,ca.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 A=0;A<2;A++)n.isNull(A)||!n.isArea()||r.isNull(A)||(0===r.getDelta(A)?n.toLine(A):(bo.isTrue(!r.isNull(A,ca.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(A,ca.LEFT,r.getLocation(A,ca.LEFT)),bo.isTrue(!r.isNull(A,ca.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(A,ca.RIGHT,r.getLocation(A,ca.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}(cl);fl.overlayOp=function(t,e,n){return new fl(t,e).getResultGeometry(n)},fl.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return fl.createEmptyResult(fl.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Tc.map(t,{interfaces_:function(){return[ll.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Yc.overlayOp(t,e,fl.INTERSECTION)},fl.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return fl.createEmptyResult(fl.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Yc.overlayOp(t,e,fl.SYMDIFFERENCE)},fl.resultDimension=function(t,e,n){var r=e.getDimension(),A=n.getDimension(),i=-1;switch(t){case fl.INTERSECTION:i=Math.min(r,A);break;case fl.UNION:i=Math.max(r,A);break;case fl.DIFFERENCE:i=r;break;case fl.SYMDIFFERENCE:i=Math.max(r,A)}return i},fl.createEmptyResult=function(t,e,n,r){var A=null;switch(fl.resultDimension(t,e,n)){case-1:A=r.createGeometryCollection(new Array(0).fill(null));break;case 0:A=r.createPoint();break;case 1:A=r.createLineString();break;case 2:A=r.createPolygon()}return A},fl.difference=function(t,e){return t.isEmpty()?fl.createEmptyResult(fl.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Yc.overlayOp(t,e,fl.DIFFERENCE))},fl.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return fl.isResultOfOp(n,r,e)}if(3===arguments.length){var A=arguments[0],i=arguments[1];switch(A===$i.BOUNDARY&&(A=$i.INTERIOR),i===$i.BOUNDARY&&(i=$i.INTERIOR),arguments[2]){case fl.INTERSECTION:return A===$i.INTERIOR&&i===$i.INTERIOR;case fl.UNION:return A===$i.INTERIOR||i===$i.INTERIOR;case fl.DIFFERENCE:return A===$i.INTERIOR&&i!==$i.INTERIOR;case fl.SYMDIFFERENCE:return A===$i.INTERIOR&&i!==$i.INTERIOR||A!==$i.INTERIOR&&i===$i.INTERIOR}return!1}},fl.INTERSECTION=1,fl.UNION=2,fl.DIFFERENCE=3,fl.SYMDIFFERENCE=4;var hl=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new lc,this._seg=new eu;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};hl.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var r=e._linework.getGeometryN(n).getCoordinateSequence(),A=0;A<r.size()-1;A++){if(r.getCoordinate(A,e._seg.p0),r.getCoordinate(A+1,e._seg.p1),e._seg.distance(t)<=e._boundaryDistanceTolerance)return!0}return!1},hl.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?$i.BOUNDARY:this._ptLocator.locate(t,this._g)},hl.prototype.extractLinework=function(t){var e=new pl;t.apply(e);var n=e.getLinework(),r=na.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},hl.prototype.interfaces_=function(){return[]},hl.prototype.getClass=function(){return hl};var pl=function(){this._linework=null,this._linework=new Ho};pl.prototype.getLinework=function(){return this._linework},pl.prototype.filter=function(t){if(t instanceof Fs){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},pl.prototype.interfaces_=function(){return[ms]},pl.prototype.getClass=function(){return pl};var dl=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};dl.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),A=0;A<r.length-1;A++)this.computeOffsetPoints(r[A],r[A+1],e,n)},dl.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},dl.prototype.getPoints=function(t){for(var e=new Ho,n=cc.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},dl.prototype.computeOffsetPoints=function(t,e,n,r){var A=e.x-t.x,i=e.y-t.y,o=Math.sqrt(A*A+i*i),s=n*A/o,a=n*i/o,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var l=new Yi(u-a,c+s);r.add(l)}if(this._doRight){var f=new Yi(u+a,c-s);r.add(f)}},dl.prototype.interfaces_=function(){return[]},dl.prototype.getClass=function(){return dl};var gl=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 Ho;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new hl(this._geom[0],this._boundaryDistanceTolerance),new hl(this._geom[1],this._boundaryDistanceTolerance),new hl(this._geom[2],this._boundaryDistanceTolerance)]},yl={TOLERANCE:{configurable:!0}};gl.prototype.reportResult=function(t,e,n){lo.out.println("Overlay result invalid - A:"+$i.toLocationSymbol(e[0])+" B:"+$i.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+$i.toLocationSymbol(e[2]))},gl.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},gl.prototype.checkValid=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var r=t._testCoords.get(n);if(!t.checkValid(e,r))return t._invalidLocation=r,!1}return!0}if(2===arguments.length){var A=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),!!gl.hasLocation(this._location,$i.BOUNDARY)||this.isValidResult(A,this._location)}},gl.prototype.addTestPts=function(t){var e=new dl(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},gl.prototype.isValidResult=function(t,e){var n=fl.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===$i.INTERIOR);return r||this.reportResult(t,e,n),r},gl.prototype.getInvalidLocation=function(){return this._invalidLocation},gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl},gl.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},gl.computeBoundaryDistanceTolerance=function(t,e){return Math.min(kc.computeSizeBasedSnapTolerance(t),kc.computeSizeBasedSnapTolerance(e))},gl.isValid=function(t,e,n,r){return new gl(t,e,r).isValid(n)},yl.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(gl,yl);var _l=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};_l.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)}},_l.prototype.combine=function(){for(var t=new Ho,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)},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l},_l.combine=function(){return 1===arguments.length?new _l(arguments[0]).combine():2===arguments.length?new _l(_l.createList(arguments[0],arguments[1])).combine():3===arguments.length?new _l(_l.createList(arguments[0],arguments[1],arguments[2])).combine():void 0},_l.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},_l.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Ho;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2],o=new Ho;return o.add(r),o.add(A),o.add(i),o}};var ml=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Ho)},vl={STRTREE_NODE_CAPACITY:{configurable:!0}};ml.prototype.reduceToGeometries=function(t){for(var e=new Ho,n=t.iterator();n.hasNext();){var r=n.next(),A=null;Ki(r,Yo)?A=this.unionTree(r):r instanceof Mo&&(A=r),e.add(A)}return e},ml.prototype.extractByEnvelope=function(t,e,n){for(var r=new Ho,A=0;A<e.getNumGeometries();A++){var i=e.getGeometryN(A);i.getEnvelopeInternal().intersects(t)?r.add(i):n.add(i)}return this._geomFactory.buildGeometry(r)},ml.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return _l.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var A=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,A)},ml.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 ja(ml.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)},ml.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 A=ml.getGeometry(e,n);return this.unionSafe(A,null)}if(r-n==2)return this.unionSafe(ml.getGeometry(e,n),ml.getGeometry(e,n+1));var i=Math.trunc((r+n)/2),o=this.binaryUnion(e,n,i),s=this.binaryUnion(e,i,r);return this.unionSafe(o,s)}},ml.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},ml.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},ml.prototype.unionActual=function(t,e){return ml.restrictToPolygons(t.union(e))},ml.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},ml.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Ho,A=this.extractByEnvelope(n,t,r),i=this.extractByEnvelope(n,e,r),o=this.unionActual(A,i);return r.add(o),_l.combine(r)},ml.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)}},ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml},ml.restrictToPolygons=function(t){if(Ki(t,Bs))return t;var e=uc.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(na.toPolygonArray(e))},ml.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},ml.union=function(t){return new ml(t).union()},vl.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ml,vl);var El=function(){};function wl(){return new bl}function bl(){this.reset()}El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El},El.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return fl.createEmptyResult(fl.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Yc.overlayOp(t,e,fl.UNION)},bl.prototype={constructor:bl,reset:function(){this.s=this.t=0},add:function(t){Cl(Il,t,this.t),Cl(this,Il.s,this.s),this.s?this.t+=Il.t:this.s=Il.t},valueOf:function(){return this.s}};var Il=new bl;function Cl(t,e,n){var r=t.s=e+n,A=r-e,i=r-A;t.t=e-i+(n-A)}var xl=1e-6,Nl=Math.PI,Sl=Nl/2,Dl=Nl/4,Ll=2*Nl,Tl=180/Nl,Ml=Nl/180,Ol=Math.abs,Rl=Math.atan,Pl=Math.atan2,kl=Math.cos,Bl=Math.sin,Fl=Math.sqrt;function Gl(t){return t>1?0:t<-1?Nl:Math.acos(t)}function Ul(t){return t>1?Sl:t<-1?-Sl:Math.asin(t)}function Ql(){}function Vl(t,e){t&&jl.hasOwnProperty(t.type)&&jl[t.type](t,e)}var zl,ql,Yl={Feature:function(t,e){Vl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,A=n.length;++r<A;)Vl(n[r].geometry,e)}},jl={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,A=n.length;++r<A;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Hl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)Hl(n[r],e,0)},Polygon:function(t,e){Xl(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)Xl(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,A=n.length;++r<A;)Vl(n[r],e)}};function Hl(t,e,n){var r,A=-1,i=t.length-n;for(e.lineStart();++A<i;)r=t[A],e.point(r[0],r[1],r[2]);e.lineEnd()}function Xl(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Hl(t[n],e,1);e.polygonEnd()}function $l(t){return[Pl(t[1],t[0]),Ul(t[2])]}function Wl(t){var e=t[0],n=t[1],r=kl(n);return[r*kl(e),r*Bl(e),Bl(n)]}function Kl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Zl(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 Jl(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function tf(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ef(t){var e=Fl(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function nf(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 rf(t,e){return[t>Nl?t-Ll:t<-Nl?t+Ll:t,e]}function Af(t){return function(e,n){return[(e+=t)>Nl?e-Ll:e<-Nl?e+Ll:e,n]}}function of(t){var e=Af(t);return e.invert=Af(-t),e}function sf(t,e){var n=kl(t),r=Bl(t),A=kl(e),i=Bl(e);function o(t,e){var o=kl(e),s=kl(t)*o,a=Bl(t)*o,u=Bl(e),c=u*n+s*r;return[Pl(a*A-c*i,s*n-u*r),Ul(c*A+a*i)]}return o.invert=function(t,e){var o=kl(e),s=kl(t)*o,a=Bl(t)*o,u=Bl(e),c=u*A-a*i;return[Pl(a*A+u*i,s*n+c*r),Ul(c*n-s*r)]},o}function af(t,e){(e=Wl(e))[0]-=t,ef(e);var n=Gl(-e[1]);return((-e[2]<0?-n:n)+Ll-xl)%Ll}function uf(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Ql,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function cf(t,e){return Ol(t[0]-e[0])<xl&&Ol(t[1]-e[1])<xl}function lf(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 ff(t,e,n,r,A){var i,o,s=[],a=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(cf(r,o)){for(A.lineStart(),i=0;i<e;++i)A.point((r=t[i])[0],r[1]);A.lineEnd()}else s.push(n=new lf(r,t,null,!0)),a.push(n.o=new lf(r,null,n,!1)),s.push(n=new lf(o,t,null,!1)),a.push(n.o=new lf(o,null,n,!0))}})),s.length){for(a.sort(e),hf(s),hf(a),i=0,o=a.length;i<o;++i)a[i].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,A.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(i=0,o=u.length;i<o;++i)A.point((c=u[i])[0],c[1]);else r(f.x,f.n.x,1,A);f=f.n}else{if(h)for(u=f.p.z,i=u.length-1;i>=0;--i)A.point((c=u[i])[0],c[1]);else r(f.x,f.p.x,-1,A);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);A.lineEnd()}}}function hf(t){if(e=t.length){for(var e,n,r=0,A=t[0];++r<e;)A.n=n=t[r],n.p=A,A=n;A.n=n=t[0],n.p=A}}function pf(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function df(t){for(var e,n,r,A=t.length,i=-1,o=0;++i<A;)o+=t[i].length;for(n=new Array(o);--A>=0;)for(e=(r=t[A]).length;--e>=0;)n[--o]=r[e];return n}wl(),wl(),wl(),rf.invert=rf,1===(zl=pf).length&&(ql=zl,zl=function(t,e){return pf(ql(t),e)});var gf=1e9,yf=-gf;function _f(t,e,n,r){function A(A,i){return t<=A&&A<=n&&e<=i&&i<=r}function i(A,i,s,u){var c=0,l=0;if(null==A||(c=o(A,s))!==(l=o(i,s))||a(A,i)<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(i[0],i[1])}function o(r,A){return Ol(r[0]-t)<xl?A>0?0:3:Ol(r[0]-n)<xl?A>0?2:1:Ol(r[1]-e)<xl?A>0?1:0:A>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=uf(),E={point:w,lineStart:function(){E.point=b,u&&u.push(c=[]);y=!0,g=!1,p=d=NaN},lineEnd:function(){a&&(b(l,f),h&&g&&v.rejoin(),a.push(v.result()));E.point=w,g&&m.lineEnd()},polygonStart:function(){m=v,a=[],u=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,A=u.length;n<A;++n)for(var i,o,s=u[n],a=1,c=s.length,l=s[0],f=l[0],h=l[1];a<c;++a)i=f,o=h,f=(l=s[a])[0],h=l[1],o<=r?h>r&&(f-i)*(r-o)>(h-o)*(t-i)&&++e:h<=r&&(f-i)*(r-o)<(h-o)*(t-i)&&--e;return e}(),n=_&&e,A=(a=df(a)).length;(n||A)&&(o.polygonStart(),n&&(o.lineStart(),i(null,null,1,o),o.lineEnd()),A&&ff(a,s,e,i,o),o.polygonEnd());m=o,a=u=c=null}};function w(t,e){A(t,e)&&m.point(t,e)}function b(i,o){var s=A(i,o);if(u&&c.push([i,o]),y)l=i,f=o,h=s,y=!1,s&&(m.lineStart(),m.point(i,o));else if(s&&g)m.point(i,o);else{var a=[p=Math.max(yf,Math.min(gf,p)),d=Math.max(yf,Math.min(gf,d))],v=[i=Math.max(yf,Math.min(gf,i)),o=Math.max(yf,Math.min(gf,o))];!function(t,e,n,r,A,i){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=A-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=i-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(i,o),_=!1):(g||(m.lineStart(),m.point(a[0],a[1])),m.point(v[0],v[1]),s||m.lineEnd(),_=!1)}p=i,d=o,g=s}return E}}var mf=wl();function vf(t){return t}wl(),wl(),wl();var Ef=1/0,wf=Ef,bf=-Ef,If=bf,Cf={point:function(t,e){t<Ef&&(Ef=t);t>bf&&(bf=t);e<wf&&(wf=e);e>If&&(If=e)},lineStart:Ql,lineEnd:Ql,polygonStart:Ql,polygonEnd:Ql,result:function(){var t=[[Ef,wf],[bf,If]];return bf=If=-(wf=Ef=1/0),t}};function xf(t,e,n,r){return function(A,i){var o,s,a,u=e(i),c=A.invert(r[0],r[1]),l=uf(),f=e(l),h=!1,p={point:d,lineStart:y,lineEnd:_,polygonStart:function(){p.point=m,p.lineStart=v,p.lineEnd=E,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=_,s=df(s);var t=function(t,e){var n=e[0],r=e[1],A=[Bl(n),-kl(n),0],i=0,o=0;mf.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+Dl,p=Bl(h),d=kl(h),g=0;g<c;++g,f=_,p=v,d=E,l=y){var y=u[g],_=y[0],m=y[1]/2+Dl,v=Bl(m),E=kl(m),w=_-f,b=w>=0?1:-1,I=b*w,C=I>Nl,x=p*v;if(mf.add(Pl(x*b*Bl(I),d*E+x*kl(I))),i+=C?w+b*Ll:w,C^f>=n^_>=n){var N=Zl(Wl(l),Wl(y));ef(N);var S=Zl(A,N);ef(S);var D=(C^w>=0?-1:1)*Ul(S[2]);(r>D||r===D&&(N[0]||N[1]))&&(o+=C^w>=0?1:-1)}}return(i<-xl||i<xl&&mf<-xl)^1&o}(o,c);s.length?(h||(i.polygonStart(),h=!0),ff(s,Sf,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){var r=A(e,n);t(e=r[0],n=r[1])&&i.point(e,n)}function g(t,e){var n=A(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=A(t,e);f.point(n[0],n[1])}function v(){f.lineStart(),a=[]}function E(){m(a[0][0],a[0][1]),f.lineEnd();var t,e,n,r,A=f.clean(),u=l.result(),c=u.length;if(a.pop(),o.push(a),a=null,c)if(1&A){if((e=(n=u[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else c>1&&2&A&&u.push(u.pop().concat(u.shift())),s.push(u.filter(Nf))}return p}}function Nf(t){return t.length>1}function Sf(t,e){return((t=t.x)[0]<0?t[1]-Sl-xl:Sl-t[1])-((e=e.x)[0]<0?e[1]-Sl-xl:Sl-e[1])}wl();var Df=xf((function(){return!0}),(function(t){var e,n=NaN,r=NaN,A=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Nl:-Nl,a=Ol(i-n);Ol(a-Nl)<xl?(t.point(n,r=(r+o)/2>0?Sl:-Sl),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(i,r),e=0):A!==s&&a>=Nl&&(Ol(n-A)<xl&&(n-=A*xl),Ol(i-s)<xl&&(i-=s*xl),r=function(t,e,n,r){var A,i,o=Bl(t-n);return Ol(o)>xl?Rl((Bl(e)*(i=kl(r))*Bl(n)-Bl(r)*(A=kl(e))*Bl(t))/(A*i*o)):(e+r)/2}(n,r,i,o),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=i,r=o),A=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var A;if(null==t)A=n*Sl,r.point(-Nl,A),r.point(0,A),r.point(Nl,A),r.point(Nl,0),r.point(Nl,-A),r.point(0,-A),r.point(-Nl,-A),r.point(-Nl,0),r.point(-Nl,A);else if(Ol(t[0]-e[0])>xl){var i=t[0]<e[0]?Nl:-Nl;A=n*i/2,r.point(-i,A),r.point(0,A),r.point(i,A)}else r.point(e[0],e[1])}),[-Nl,-Sl]);function Lf(t,e){var n=kl(t),r=n>0,A=Ol(n)>xl;function i(t,e){return kl(t)*kl(e)>n}function o(t,e,r){var A=[1,0,0],i=Zl(Wl(t),Wl(e)),o=Kl(i,i),s=i[0],a=o-s*s;if(!a)return!r&&t;var u=n*o/a,c=-n*s/a,l=Zl(A,i),f=tf(A,u);Jl(f,tf(i,c));var h=l,p=Kl(f,h),d=Kl(h,h),g=p*p-d*(Kl(f,f)-1);if(!(g<0)){var y=Fl(g),_=tf(h,(-p-y)/d);if(Jl(_,f),_=$l(_),!r)return _;var m,v=t[0],E=e[0],w=t[1],b=e[1];E<v&&(m=v,v=E,E=m);var I=E-v,C=Ol(I-Nl)<xl;if(!C&&b<w&&(m=w,w=b,b=m),C||I<xl?C?w+b>0^_[1]<(Ol(_[0]-v)<xl?w:b):w<=_[1]&&_[1]<=b:I>Nl^(v<=_[0]&&_[0]<=E)){var x=tf(h,(-p+y)/d);return Jl(x,f),[_,$l(x)]}}}function s(e,n){var A=r?t:Nl-t,i=0;return e<-A?i|=1:e>A&&(i|=2),n<-A?i|=4:n>A&&(i|=8),i}return xf(i,(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=i(l,f),g=r?d?0:s(l,f):d?s(l+(l<0?Nl:-Nl),f):0;if(!e&&(u=a=d)&&t.lineStart(),d!==a&&(!(h=o(e,p))||cf(e,h)||cf(p,h))&&(p[0]+=xl,p[1]+=xl,d=i(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(A&&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&&cf(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,A,i){!function(t,e,n,r,A,i){if(n){var o=kl(e),s=Bl(e),a=r*n;null==A?(A=e+r*Ll,i=e-a/2):(A=af(o,A),i=af(o,i),(r>0?A<i:A>i)&&(A+=r*Ll));for(var u,c=A;r>0?c>i:c<i;c-=a)u=$l([o,-s*kl(c),-s*Bl(c)]),t.point(u[0],u[1])}}(i,t,e,A,n,r)}),r?[0,-t]:[-Nl,t-Nl])}function Tf(t){return function(e){var n=new Mf;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Mf(){}function Of(t,e,n){var r=e[1][0]-e[0][0],A=e[1][1]-e[0][1],i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),function(t,e){t&&Yl.hasOwnProperty(t.type)?Yl[t.type](t,e):Vl(t,e)}(n,t.stream(Cf));var o=Cf.result(),s=Math.min(r/(o[1][0]-o[0][0]),A/(o[1][1]-o[0][1])),a=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(A-s*(o[1][1]+o[0][1]))/2;return null!=i&&t.clipExtent(i),t.scale(150*s).translate([a,u])}Mf.prototype={constructor:Mf,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 Rf=16,Pf=kl(30*Ml);function kf(t,e){return+e?function(t,e){function n(r,A,i,o,s,a,u,c,l,f,h,p,d,g){var y=u-r,_=c-A,m=y*y+_*_;if(m>4*e&&d--){var v=o+f,E=s+h,w=a+p,b=Fl(v*v+E*E+w*w),I=Ul(w/=b),C=Ol(Ol(w)-1)<xl||Ol(i-l)<xl?(i+l)/2:Pl(E,v),x=t(C,I),N=x[0],S=x[1],D=N-r,L=S-A,T=_*D-y*L;(T*T/m>e||Ol((y*D+_*L)/m-.5)>.3||o*f+s*h+a*p<Pf)&&(n(r,A,i,o,s,a,N,S,C,v/=b,E/=b,w,d,g),g.point(N,S),n(N,S,C,v,E,w,u,c,l,f,h,p,d,g))}}return function(e){var r,A,i,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,A){var i=Wl([r,A]),o=t(r,A);n(c,l,u,f,h,p,c=o[0],l=o[1],u=r,f=i[0],h=i[1],p=i[2],Rf,e),e.point(c,l)}function m(){d.point=g,e.lineEnd()}function v(){y(),d.point=E,d.lineEnd=w}function E(t,e){_(r=t,e),A=c,i=l,o=f,s=h,a=p,d.point=_}function w(){n(c,l,u,f,h,p,A,i,r,o,s,a,Rf,e),d.lineEnd=m,m()}return d}}(t,e):function(t){return Tf({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Bf=Tf({point:function(t,e){this.stream.point(t*Ml,e*Ml)}});function Ff(t){return function(t){var e,n,r,A,i,o,s,a,u,c,l=150,f=480,h=250,p=0,d=0,g=0,y=0,_=0,m=null,v=Df,E=null,w=vf,b=.5,I=kf(N,b);function C(t){return[(t=i(t[0]*Ml,t[1]*Ml))[0]*l+n,r-t[1]*l]}function x(t){return(t=i.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*Tl,t[1]*Tl]}function N(t,A){return[(t=e(t,A))[0]*l+n,r-t[1]*l]}function S(){i=nf(A=function(t,e,n){return(t%=Ll)?e||n?nf(of(t),sf(e,n)):of(t):e||n?sf(e,n):rf}(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,C}return C.stream=function(t){return u&&c===t?u:u=Bf(v(A,I(w(c=t))))},C.clipAngle=function(t){return arguments.length?(v=+t?Lf(m=t*Ml,6*Ml):(m=null,Df),D()):m*Tl},C.clipExtent=function(t){return arguments.length?(w=null==t?(E=o=s=a=null,vf):_f(E=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1]),D()):null==E?null:[[E,o],[s,a]]},C.scale=function(t){return arguments.length?(l=+t,S()):l},C.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],S()):[f,h]},C.center=function(t){return arguments.length?(p=t[0]%360*Ml,d=t[1]%360*Ml,S()):[p*Tl,d*Tl]},C.rotate=function(t){return arguments.length?(g=t[0]%360*Ml,y=t[1]%360*Ml,_=t.length>2?t[2]%360*Ml:0,S()):[g*Tl,y*Tl,_*Tl]},C.precision=function(t){return arguments.length?(I=kf(N,b=t*t),D()):Fl(b)},C.fitExtent=function(t,e){return Of(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return Of(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&x,S()}}((function(){return t}))()}function Gf(t){return function(e,n){var r=kl(e),A=kl(n),i=t(r*A);return[i*A*Bl(e),i*Bl(n)]}}function Uf(t){return function(e,n){var r=Fl(e*e+n*n),A=t(r),i=Bl(A),o=kl(A);return[Pl(e*i,r*o),Ul(r&&n*i/r)]}}Gf((function(t){return Fl(2/(1+t))})).invert=Uf((function(t){return 2*Ul(t/2)}));var Qf=Gf((function(t){return(t=Gl(t))&&t/Bl(t)}));function Vf(){return Ff(Qf).scale(79.4188).clipAngle(179.999)}function zf(t,e){return[t,e]}function qf(t,e,n,r){var A=t.properties||{},i="Feature"===t.type?t.geometry:t;if("GeometryCollection"===i.type){var o=[];return wi(t,(function(t){var A=qf(t,e,n,r);A&&o.push(A)})),pi(o)}var s=function(t){var e=Ti(t).geometry.coordinates,n=[-e[0],-e[1]];return Vf().rotate(n).scale(ui)}(i),a={type:i.type,coordinates:jf(i.coordinates,s)},u=(new aa).read(a),c=di(gi(e,n),"meters"),l=ec.bufferOp(u,c,r);if(!Yf((l=(new ua).write(l)).coordinates))return li({type:l.type,coordinates:Hf(l.coordinates,s)},A)}function Yf(t){return Array.isArray(t[0])?Yf(t[0]):isNaN(t[0])}function jf(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return jf(t,e)}))}function Hf(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Hf(t,e)}))}Qf.invert=Uf((function(t){return t})),zf.invert=zf;const Xf={HOURS_AGO:2,SEVERITY:0,ALT_FROM:5,ALT_TO:52},$f="[SkyPath SDK]: Flow is not running",Wf="[SkyPath SDK]: Flow already started",Kf="[SkyPath SDK]: Flow already terminated",Zf={INITIALIZED:"initialized",RUNNING:"running",STOPPED:"stopped",TERMINATED:"terminated"},Jf=t=>{const e=structuredClone(t);return th(e)},th=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})),eh=([t,e])=>[Math.max(-180,Math.min(180,t)),Math.max(-90,Math.min(90,e))],nh=(t,e)=>(void 0===e&&(e={}),{type:"Feature",id:t,properties:e,geometry:{type:"Polygon",coordinates:[HA(t)]}}),rh=(t,e)=>{const n=[];for(let r=0;r<t.length;r++){const A=t[r],i=e?.(A)||{};n.push(nh(A,i))}return{type:"FeatureCollection",features:n}},Ah=(t=[],e=1)=>{if(!t||!t.length)return;const n=t.reduce(((t,e)=>(t[e.hexId]=e,t)),{}),r=rh(t.map((({hexId:t})=>t)),(t=>n[t])).features.map((t=>{const n=Pi(hi(t.geometry.coordinates),e);return{...t,geometry:n.geometry}}));return{type:"FeatureCollection",features:r}},ih=({hexagons:t})=>t.reduce(((t,e)=>{const{hexId:n,sev:r,alt:A,observationTime:i}=e;return(!t[n]||t[n].sev<r)&&(t[n]={hexId:n,sev:r,alt:A,observationTime:i}),t}),{}),oh=([t,e])=>[e,t],sh=(t,e=0)=>{const n=Li(t).geometry.coordinates.map((t=>t.map(oh)));return WA(n,e)},ah=(t,e=0,n=!0)=>{const r=t.map((t=>n?oh(t):t));return WA(r,e)},uh=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{hoursAgo:n=Xf.HOURS_AGO,altitudeFrom:r=Xf.ALT_FROM,altitudeTo:A=Xf.ALT_TO,severity:i=Xf.SEVERITY}=e,o=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=r&&t<=A)).filter((({sev:t})=>t>=i)).filter((({observationTime:t})=>ai().unix()-t<=3600*n))])).filter((([,t])=>t.length>0));return Object.fromEntries(o)},ch=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>Array.isArray(n)?n.map((({hexId:n,...r})=>({hexId:$A(n,t,e),...r}))):null)).filter(Boolean)},lh={0:700,1:300},fh=({polygon:t,resolution:e,extensionFactor:n=1})=>{const r=function(t,e,n){var r=(n=n||{}).units||"kilometers",A=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 A)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(A<=0)throw new Error("steps must be greater than 0");var i=[];switch(t.type){case"GeometryCollection":return wi(t,(function(t){var n=qf(t,e,r,A);n&&i.push(n)})),pi(i);case"FeatureCollection":return Ei(t,(function(t){var n=qf(t,e,r,A);n&&Ei(n,(function(t){t&&i.push(t)}))})),pi(i)}return qf(t,e,r,A)}(hi([t]),lh[e]*n,{units:"kilometers"});return r.geometry.coordinates[0]},hh=({polygon:t,precision:e=1})=>{const n=hi([t]);return Number(Math.log2(360/(bi(n)[2]-bi(n)[0])).toFixed(e))},ph={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE",CORRIDOR:"CORRIDOR"},dh={[ph.LARGE]:2,[ph.MEDIUM]:3.5,[ph.SMALL]:1/0},gh=(t,e=dh)=>{const n=hh({polygon:t});return Object.entries(e).find((([,t])=>n<=t))[0]};function yh(t){return t*Math.PI/180}function _h(t){return 180*t/Math.PI}function mh(t){const e=6378137,[n,r,A,i]=t,o=yh(n),s=yh(r),a=yh(A),u=yh(i),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[_h(h),_h(p)]}const vh=({polygon:t,resolution:e,extensionFactor:n})=>{const r=bi(hi([t])),A=Li(bi(fi(mh(r)))).geometry.coordinates[0];return fh({polygon:A,resolution:e,extensionFactor:n})};var Eh=Object.freeze({__proto__:null,HEX_RESOLUTION_BUFFERS:lh,POLYGON_TYPE:ph,adjustAntiMeridianCrossing:Jf,adjustFeatureCoordinates:t=>Jf(t).map(eh),clampCoordinates:eh,extendPolygonByResolution:fh,getHexIdsByMapBoundsAndResolution:sh,getHexIdsByPolygonAndResolution:ah,getHexIdsFromMapboxMap:(t,e)=>{if(!t)return;const n=t.getBounds().toArray().flat();return sh(n,e)},getHexagonsDataSlice:uh,getHexagonsFeatureCollection:Ah,getMapPolygon:t=>{const e=t.getBounds().toArray().flat(),[n,r,A,i]=e;return[[n,i],[n,r],[A,r],[A,i],[n,i]]},getMercatorCenterFromBbox:mh,getMiddleArea:vh,getOneLayerHexagonsDataSlice:({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{altitudeFrom:n=Xf.ALT_FROM,altitudeTo:r=Xf.ALT_TO,severity:A=Xf.SEVERITY}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=n&&t<=r)).map((t=>{const e=t.severities.filter((({sev:t})=>t>=A));return{...t,severities:e}})).filter((({severities:t})=>t.length>0))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},getPolygonSize:gh,getZoomLevel:hh,groupByHexIdAndSelectMostSevere:ih,h3SetToFeatureCollection:rh,h3ToFeature:nh,invertLatLng:oh,normalizeAntiMeridian:th,prepareHexagonsDataForMapHexagons:ch,prepareOneLayerHexagonsDataForMapHexagons:({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.map((({hexId:n,alt:r,severities:A})=>({hexId:$A(n,t,e),alt:r,...A[0]})))))}});const wh=({event:t,listener:e})=>{if("string"!=typeof t||"function"!=typeof e)throw new sA(`Invalid params - event must be a string and listener must be a function,\n received event - ${t}, listener - ${e}`)};class bh{constructor(){this.#e=new Map}#e;on(t,e){wh({event:t,listener:e}),this.#e.has(t)||this.#e.set(t,[]),this.#e.get(t).push(e)}off(t,e){if(wh({event:t,listener:e}),!this.#e.has(t))return;const n=this.#e.get(t).filter((t=>t!==e));n.length>0?this.#e.set(t,n):this.#e.delete(t)}emit(t,...e){(({event:t})=>{if("string"!=typeof t)throw new sA(`Invalid params - event must be a string, received event - ${t}`)})({event:t}),this.#e.has(t)&&this.#e.get(t).forEach((t=>{t(...e)}))}once(t,e){wh({event:t,listener:e});const n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n)}clear(){this.#e.clear()}}class Ih{#n=Zf.INITIALIZED;start(){if(this.#n===Zf.RUNNING)throw new Error(Wf);this.#n=Zf.RUNNING}stop(){if(this.#n===Zf.TERMINATED)throw new Error(Kf);if(this.#n===Zf.INITIALIZED)throw new Error($f);this.#n=Zf.STOPPED}terminate(){if(this.#n===Zf.TERMINATED)throw new Error(Kf);if(this.#n===Zf.INITIALIZED)throw new Error($f);this.#n=Zf.TERMINATED}get isInitialRun(){return[Zf.INITIALIZED,Zf.TERMINATED].includes(this.#n)}get state(){return this.#n}get isRunning(){return this.#n===Zf.RUNNING}get isStopped(){return this.#n===Zf.STOPPED}get isTerminated(){return this.#n===Zf.TERMINATED}}const Ch={INFO:"/v5/nowcasting/info",DATA:"/v5/nowcasting/{resolution}/{hexId}"},xh="DATA",Nh="UPDATE_CONFIG",Sh="UPDATE_INTERVAL",Dh="LOAD_NOWCASTING_DATA",Lh="IS_PENDING_CHANGE",Th={FORECAST:0,SEVERITY:2,ALTITUDE:35},Mh=({edrValue:t})=>t<=.13?0:t<=.18?1:t<=.25?2:t<=.4?3:4;class Oh{constructor({cacheTokenService:t,nowcastingService:e}){this.#r=9e5,this.#A=t,this.#i=e,this.#o=new Ih,this.#s=new Set}#r;#o;#s;#a=new bh;onData=t=>{if(!ti(t))throw new sA(eA);this.#a.on(xh,t)};updateConfig=(t={})=>{this.#a.emit(Nh,t)};onChangeIsPending=t=>{if(!ti(t))throw new sA(eA);this.#a.on(Lh,t)};#A;#i;#u=[];#c=[];#l=null;#f=null;#h=new Map;#p=async()=>await this.#A.getToken();#d=async()=>{const{lastUpdatedAt:t}=await this.#i.getInfo();return t};#g=async(t,e,n,r,A)=>{try{if(this.#A.checkToken(t)||(t=await this.#p()),!r?.length)return{token:t};A&&e.clear();const i=r.filter((t=>!this.#s.has(t)));i.forEach((t=>this.#s.add(t)));const o=i.filter((t=>!e.has(t)));if(0===o.length)return{token:t};const s=await Promise.allSettled(o.map((e=>{return this.#i.getData({token:t.token,lastUpdatedAt:n,resolution:(r=e,A=GA(r),i=A[0],o=A[1],NA.isValidCell(i,o)?NA.getResolution(i,o):-1),hexId:e}).then((t=>({...t,hexId:e}))).finally((()=>this.#s.delete(e)));var r,A,i,o})));s.map((t=>"rejected"===t.status?null:t.value)).forEach((t=>{if(!t?.hexId)return;const n=t.items.map((({hexIds:t,...e})=>({sev:Mh({edrValue:e?.edr}),...e,hexIds:t})));e.set(t.hexId,n)}));return{nowcastingData:Object.fromEntries(e),token:t}}catch(t){throw new lA("Failed to load nowcasting data",{error:t})}};#y=null;start(){try{const t=this.#o.state===Zf.INITIALIZED||this.#o.state===Zf.TERMINATED;this.#o.start(),this.#y=setInterval((()=>this.#a.emit(Sh,{})),this.#r),t&&(this.#a.on(Sh,this.#_),this.#a.on(Dh,this.#m),this.#a.on(Nh,this.#v));const e=t?[]:this.#c;this.#v({hexIds:e})}catch(t){throw new lA("Failed to start nowcasting flow",{error:t})}}stop(){this.#o.stop(),clearInterval(this.#y),this.#y=null,this.#s.clear()}terminate(){this.#o.terminate(),clearInterval(this.#y),this.#y=null,this.#l=null,this.#f=null,this.#u=[],this.#h.clear(),this.#s.clear(),this.#a.clear()}getState=()=>this.#o.state;#m=async({shouldEraseOldData:t=!1,hexIds:e=this.#u,token:n=this.#l,currentDataMap:r=this.#h,lastUpdatedAt:A=this.#f})=>{if(this.#o.state!==Zf.RUNNING)return;this.#a.emit(Lh,!0);const{token:i,nowcastingData:o}=await this.#g(n,r,A,e,t);this.#a.emit(Lh,!1),this.#l=i,this.#f=A,this.#u=e,o&&this.#a.emit(xh,o)};#_=async({lastUpdatedAt:t=this.#f})=>{if(this.#o.state!==Zf.RUNNING)return;const e=await this.#d();if(!(e!==t))return;this.#f=e;const n={lastUpdatedAt:t=e,shouldEraseOldData:!0};this.#a.emit(Dh,n)};#v=async({hexIds:t,polygon:e})=>{let n,r,A=e?ah(e):t||this.#u;if(this.#o.state!==Zf.RUNNING)return void(this.#c=A);this.#l||(n=await this.#p(),this.#l=n),this.#f||(r=await this.#d(),this.#f=r);const i={token:n,currentDataMap:this.#h,lastUpdatedAt:r,hexIds:A};this.#a.emit(Dh,i)}}class Rh{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:Ch.INFO})).data}catch(t){throw new aA("Failed to get nowcasting info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=Ch.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r,forecastH:13};return(await this.#t({path:A,params:i})).data}catch(t){throw new aA("Failed to get nowcasting data",{error:t})}}}const Ph="/v4/aircraft";class kh{constructor({fetcher:t}){this.#t=t}#t;async getMapping(){try{const t=Ph;return await this.#t({path:t,method:Br})}catch(t){throw new aA("Failed to get aircraft mapping",{error:t})}}}const Bh="/v5/cache-token",Fh=t=>{if(!t?.expireAt)return!1;const e=(new Date).getTime();return new Date(t.expireAt).getTime()>e};class Gh{#t;constructor({fetcher:t}){this.#t=t}getToken=async()=>{try{return(await this.#t({path:Bh})).data}catch(t){throw new aA("Failed to get cache token",{error:t})}};checkToken=Fh}const Uh=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 A=(await t.json().catch((()=>{})))?.message?.split(":")?.at(1)?.trim()||"";return[r,A?`(${A})`:""].join(" ")};class Qh{#E;constructor({environment:t,proxyUrl:e}){this.#E=e||Kr[t?.toLowerCase()]||Kr[$r]}authenticate=async({apiKey:t,userId:e,companyName:n,authCallback:r})=>{if(![t,e,n,r].filter(Boolean).length)throw new sA(nA);return r?await this.#w({authCallback:r}):await this.#b({apiKey:t,userId:e,companyName:n})};async#I({token:t}){const e=`${this.#E}${Yr}`,n={method:Br,headers:{[Ur]:t}},r=await fetch(e,n);if(!r.ok){const t=await Uh({response:r});throw new Error(t)}const{companyId:A,id:i}=await r.json();return{companyId:A,userId:i}}async#b({apiKey:t,userId:e,companyName:n}){try{const r=await this.#C({apiKey:t,userId:e,companyName:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new cA(AA,{error:t})}}async#w({authCallback:t}){try{const{jwt:e,partnerId:n}=await t(),r=await this.#N({jwt:e,partnerId:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new cA(rA,{error:t})}}#S=async({path:t,headers:e={},body:n})=>{try{const r=`${this.#E}${t}`,A={method:Fr,headers:{[Qr]:"application/json",...e},body:n?JSON.stringify(n):null},i=await fetch(r,A);if(!i.ok){const t=await Uh({response:i});throw new Error(t)}const{token:o}=await i.json();return o}catch(t){throw new aA(iA,{error:t})}};#C=async({apiKey:t,userId:e,companyName:n})=>await this.#S({path:Vr,headers:{[Gr]:t},body:{user_id:e,airline_icao:n}});#N=async({jwt:t,partnerId:e})=>await this.#S({path:zr,body:{signedJwt:t,partnerId:e}});#D=async({token:t})=>await this.#S({path:qr,body:{token:t}});#x=({token:t})=>async({path:e="",method:n=Br,params:r,headers:A={},body:i=null,signal:o=null,retry:s=3})=>{let a=0;const u=r?"?"+new URLSearchParams(Object.fromEntries(Object.entries(r||{}).filter((([,t])=>null!=t)))):"",c={url:`${this.#E}${e}${u}`,options:{method:n,headers:{...A,[Ur]:t,[Qr]:"application/json"},body:n!==Br?JSON.stringify(i):null,signal:o}};let l=null;for(;a<s;){a+=1;let e=!1;if(l=await fetch(c.url,c.options).catch((t=>{if(t===jr)return e=!0,null})),e)return{data:null,aborted:!0};if(!l||204===l.status)return{data:null};if(l.ok)return await l.json();401===l.status&&(t=await this.#D({token:t}),c.options.headers[Ur]=t)}const f=await Uh({response:l});throw new aA(f,{...l})}}const Vh={DATA:"/adsb/v5/hexagons/{resolution}/{hexId}"},zh=5,qh=52,Yh={[ph.SMALL]:1,[ph.MEDIUM]:0,[ph.LARGE]:0,[ph.CORRIDOR]:1},jh={[ph.SMALL]:0,[ph.MEDIUM]:1,[ph.LARGE]:1,[ph.CORRIDOR]:1},Hh={[ph.SMALL]:2,[ph.MEDIUM]:1,[ph.LARGE]:2.5,[ph.CORRIDOR]:1},Xh="polygon",$h="isCorridorMode",Wh=(t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=$A(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)},Kh=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 Zh{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async({polygon:t,polygonSize:e},n)=>{if(!t||!e)return null;const r=jh[e],{hexIds:A,childCells:i}=(({polygon:t,polygonSize:e})=>{let n=t;const r=Yh[e],A=Hh[e];let i,o;switch(e){case ph.LARGE:n=vh({polygon:n,resolution:r,extensionFactor:A});break;case ph.CORRIDOR:{o=WA(n,5,!0);const t=t=>XA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=fh({polygon:n,resolution:r,extensionFactor:A})}return i??=WA(n,r,!0),{hexIds:i,childCells:o}})({polygon:t,polygonSize:e});e===ph.LARGE&&([...this.#L.keys()].forEach((t=>!t.includes(e)&&this.#L.delete(t))),[...this.#L.keys()].forEach((t=>!A.includes(t.split(",")[0])&&this.#L.delete(t))));const o=A.filter((t=>{const n=String([t,e,r]);if(!this.#L.has(n))return!0;const A=this.#L.get(n),{fetchedAt:i,updatedAt:o}=A,s=ai().unix()-i,a=ai().unix()-o;return!(s<60)&&!(a<60)}));if(!o.length)return Wh(this.#L,[e,r],{childCells:i});const s=o.map((t=>{const A=Vh.DATA.replace("{hexId}",t).replace("{resolution}",String(Yh[e])),i=String([t,e,r]),o=this.#L.get(i)?.updatedAt;return this.#t({path:A,method:Br,params:{minSev:r,hoursAgo:4,maxAlt:qh,minAlt:zh,since:o},signal:n})}));return(await Promise.allSettled(s)).forEach(((t,n)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const A={fetchedAt:ai().unix(),reports:Kh(t),updatedAt:t.value.data?.updatedAt},i=o[n],s=String([i,e,r]),a=this.#L.get(s);if(!!a?.updatedAt&&!!a?.reports?.length&&a?.updatedAt!==A.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,n=a.reports,r=A.reports;n.forEach((n=>t.set(e(n),n))),r.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),o={fetchedAt:A.fetchedAt,updatedAt:A.updatedAt,reports:i};this.#L.set(s,o)}else this.#L.set(s,A)})),[...this.#L.keys()].forEach((t=>!t.includes(e)&&this.#L.delete(t))),Wh(this.#L,[e,r],{childCells:i})};expire=()=>{const t=[...this.#L.entries()],e=ai().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class Jh{constructor({fetcher:t}){this.#T=new Zh({fetcher:t}),this.#M=new AbortController,this.#O=ni(500),this.#R=ni(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1}}#P;#T;#M;#k;#B;#F;#O;#R;#G;#U;#Q;#V=async()=>{if(this.#k)try{this.#T.expire(),this.#B&&(this.#M.abort(jr),this.#M=new AbortController,this.#z(null));const t=this.#T.fetch(this.#P,this.#M.signal);this.#z(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new lA("Failed to run ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#z(null),this.#k&&this.#R.run(this.#V.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(jr),this.#M=new AbortController,this.#z(null)}catch(t){const e=new lA("Failed to stop ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#z=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!ti(t))throw new sA(eA);this.#G=t};onError=t=>{if(!ti(t))throw new sA(eA);this.#U=t};onIsProcessingChange=t=>{if(!ti(t))throw new sA(eA);this.#Q=t};start=()=>{this.#k=!0,this.#V()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e})=>{try{(({polygon:t,isCorridorMode:e})=>{if(!JA(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(!JA(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean")})({polygon:t,isCorridorMode:e});const n=Ai({current:this.#P,next:{polygon:t,isCorridorMode:e}}),r={...this.#P};if(n.has($h)&&(r.isCorridorMode=e),n.has(Xh)&&(r.polygon=t,r.polygonSize=r.isCorridorMode?ph.CORRIDOR:gh(t)),this.#P=r,!this.#k)return;this.#O.run(this.#V.bind(this))}catch(n){const r=new lA("Failed to updateConfig for ADSB flow",{error:n,config:{polygon:t,isCorridorMode:e}});if(!this.#U)throw r;this.#U(r)}}}const tp={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},ep={halfAnHour:"0.5",oneHour:"1",twoHours:"2",fourHours:"4"},np={DATA:"/one-layer/v5/{res}/{hexId}"},rp=5,Ap=52,ip={[ph.SMALL]:1,[ph.MEDIUM]:0,[ph.LARGE]:0,[ph.CORRIDOR]:1},op={[ph.SMALL]:0,[ph.MEDIUM]:1,[ph.LARGE]:1,[ph.CORRIDOR]:1},sp={[ph.SMALL]:2,[ph.MEDIUM]:1,[ph.LARGE]:2.5,[ph.CORRIDOR]:1},ap="polygon",up="isCorridorMode",cp="aircraftCategory",lp="hoursAgo",fp="forecastTs",hp="nowcastingAlt",pp=({forecastTs:t})=>{let e;return e=!t||ai.unix(t).isBefore(ai())||ai.unix(t).isBefore(ai().add(3,"minute"))?ai().unix():t,e},dp=({oneLayer:t,nowcasting:e,forecastTs:n,nowcastingAlt:r})=>{const A=new Map;t.forEach((t=>A.set(`${t.hexId}-${t.alt}`,t)));const i=(({nowcasting:t,forecastTs:e,nowcastingAlt:n})=>{const r=pp({forecastTs:e}),A=Math.floor((r-ai().unix())/3600);return t?.filter((t=>t.alt===n&&t.forecast===A))})({nowcasting:e,forecastTs:n,nowcastingAlt:r});return i?.forEach((t=>{t.hexIds.forEach((e=>{const n=`${e}-${t.alt}`;if(A.has(n)){const t=A.get(n);t.severities[0].sources.push(0),A.set(n,t)}else A.set(n,(({hexId:t,nowcastItem:e})=>({hexId:t,alt:e.alt,severities:[{edr:null,sev:2===e.sev?1:e.sev,sources:[0],observationTime:ai().add(e.forecast+1,"hour").startOf("hour").unix(),usedSource:0,usedSourceTs:ai().add(e.forecast,"hour").startOf("hour").unix()}]}))({hexId:e,nowcastItem:t}))}))})),[...A.values()]},gp=({oneLayerStore:t,nowcastingData:e,selector:n,options:r})=>{const{childCells:A,forecastTs:i,nowcastingAlt:o,hoursAgo:s}=r,a=[...t.entries()].filter((([t])=>{const[,,,...e]=t.split(",");return e.join(",")===n.join(",")})).map((([t,n])=>{const[r]=t.split(","),{reports:a}=n,u=(({reports:t,forecastTs:e,hoursAgo:n})=>{const r=pp({forecastTs:e});return t.map((t=>({...t,severities:[t.severities?.find(((t,e,A)=>{const i=A[e+1],o=t.observationTime,s=i?i.observationTime:ai.unix(t.observationTime).add(Number(n),"hour").unix();return r>=o&&r<s}))].filter(Boolean)}))).filter((t=>t.severities.length))})({reports:a,forecastTs:i,hoursAgo:s}),c=e&&e[r]?dp({oneLayer:u,nowcasting:e[r],forecastTs:i,nowcastingAlt:o}):a;if(!A?.length)return[r,c];const l=c.filter((t=>{const{hexId:e}=t,n=$A(e,r,5);return A.includes(n)}));return[r,l]}));return Object.fromEntries(a)},yp=({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]})))}))):[];class _p{constructor({fetcher:t}){this.#t=t,this.#L=new Map,this.#i=new Rh({fetcher:t}),this.#A=new Gh({fetcher:t}),this.#Y={}}#L;#t;#i;#A;#Y;fetch=async({polygon:t,polygonSize:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i,shouldIgnorePromises:o},s)=>{if(!t||!e)return null;const a=op[e],{hexIds:u,childCells:c}=(({polygon:t,polygonSize:e})=>{let n=t;const r=ip[e],A=sp[e];let i,o;switch(e){case ph.LARGE:n=vh({polygon:n,resolution:r,extensionFactor:A});break;case ph.CORRIDOR:{o=WA(n,5,!0);const t=t=>XA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=fh({polygon:n,resolution:r,extensionFactor:A})}return i??=WA(n,r,!0),{hexIds:i,childCells:o}})({polygon:t,polygonSize:e});e===ph.LARGE&&[...this.#L.keys()].forEach((t=>!u.includes(t.split(",")[0])&&this.#L.delete(t)));const l=u.filter((t=>{const o=String([t,i,A,e,a,r,n]);if(!this.#L.has(o))return!0;const s=this.#L.get(o),{fetchedAt:u,updatedAt:c}=s,l=ai().unix()-u,f=ai().unix()-c;return!(l<60)&&!(f<60)}));if(!l.length)return gp({oneLayerStore:this.#L,nowcastingData:this.#Y,selector:[e,a,r,n],options:{childCells:c,forecastTs:A,nowcastingAlt:i,hoursAgo:r}});if(!o){await new Promise((t=>{const e=new Oh({cacheTokenService:this.#A,nowcastingService:this.#i});e.onData((n=>{this.#Y={...this.#Y,...n},e.terminate(),t(n)})),e.start(),e.updateConfig({hexIds:l})}));const t=l.map((t=>{const o=np.DATA.replace("{hexId}",t).replace("{res}",String(ip[e])),u=String([t,i,A,e,a,r,n]),c=this.#L.get(u)?.updatedAt;return this.#t({path:o,method:Br,params:{acCat:n,hoursAgo:r,minAlt:rp,maxAlt:Ap,since:c},signal:s})}));(await Promise.allSettled(t)).forEach(((t,o)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const s={fetchedAt:ai().unix(),reports:yp({responseData:t?.value?.data}),updatedAt:t.value.data?.updatedAt},u=l[o],c=String([u,i,A,e,a,r,n]),f=this.#L.get(c);if(!!f?.updatedAt&&!!f?.reports?.length&&f?.updatedAt!==s.updatedAt){const t=(({oldReports:t,newReports:e})=>{const n=new Map,r=t=>`${t.hexId}-${t.alt}`;return t.forEach((t=>n.set(r(t),t))),e.forEach((t=>n.set(r(t),t))),Array.from(n.values())})({oldReports:f.reports,newReports:s.reports}),e={fetchedAt:s.fetchedAt,updatedAt:s.updatedAt,reports:t};this.#L.set(c,e)}else this.#L.set(c,s)}))}for(const[t,{reports:e,...n}]of this.#L.entries()){const r=e.map((t=>({...t,severities:t?.severities?.filter((t=>t.sev>=a))}))).filter((t=>t.severities.length));r.length?this.#L.set(t,{...n,reports:r}):this.#L.delete(t)}return[...this.#L.keys()].forEach((t=>!t.includes(e)&&this.#L.delete(t))),gp({oneLayerStore:this.#L,nowcastingData:this.#Y,selector:[e,a,r,n],options:{childCells:c,forecastTs:A,nowcastingAlt:i,hoursAgo:r}})};expire=({hoursAgo:t})=>{this.#L=(({store:t,hoursAgo:e})=>{const n=new Map(t);return[...n.entries()].forEach((t=>{const[r,A]=t,{reports:i,...o}=A,s=[];i.forEach((t=>{const n=t?.severities?.filter((t=>ai.unix(t.observationTime).add(e,"hour").unix()>ai().unix()));n.length&&s.push({...t,severities:n})})),s.length?n.set(r,{...o,reports:s}):n.delete(r)})),n})({store:this.#L,hoursAgo:t})};dispose=()=>this.#L.clear()}class mp{constructor({fetcher:t}){this.#T=new _p({fetcher:t}),this.#M=new AbortController,this.#O=ni(500),this.#R=ni(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1,hoursAgo:Number(ep.oneHour),forecastTs:null,nowcastingAlt:35,aircraftCategory:tp.C60,shouldIgnorePromises:!1}}#P;#T;#M;#k;#B;#F;#O;#R;#G;#U;#Q;#V=async()=>{if(this.#k)try{this.#T.expire({hoursAgo:this.#P.hoursAgo}),this.#B&&!this.#P.shouldIgnorePromises&&(this.#M.abort(jr),this.#M=new AbortController,this.#z(null));const t=this.#T.fetch(this.#P,this.#M.signal);this.#z(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new lA("Failed to run OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#z(null),this.#k&&this.#R.run(this.#V.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(jr),this.#M=new AbortController,this.#z(null)}catch(t){const e=new lA("Failed to stop OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#z=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!ti(t))throw new sA(eA);this.#G=t};onError=t=>{if(!ti(t))throw new sA(eA);this.#U=t};onIsProcessingChange=t=>{if(!ti(t))throw new sA(eA);this.#Q=t};start=()=>{this.#k=!0,this.#V()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i})=>{if(!JA(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(!JA(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!JA(n)){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(tp).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!JA(r)){if("string"!=typeof r)throw new Error("hoursAgo must be a string");if(!Object.values(ep).includes(r))throw new Error("hoursAgo must be one of the allowed values, '0.5', '1', '2' ,'4'")}if(!JA(A)){if("number"!=typeof A)throw new Error("hoursAgo must be a number");if(!ai.unix(A).isValid())throw new Error("forecastTs must be a valid Unix timestamp")}if(!JA(i)){if("number"!=typeof i)throw new Error("nowcastingAlt must be a number");if(i<5||i>52)throw new Error("nowcastingAlt must be a number between 5 and 52")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i});const o=Ai({current:this.#P,next:{polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:Number(r),forecastTs:A,nowcastingAlt:i}}),s={...this.#P};if(o.has(up)&&(s.isCorridorMode=e),o.has(ap)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?ph.CORRIDOR:gh(t)),o.has(cp)&&(s.aircraftCategory=n),o.has(lp)&&(s.hoursAgo=Number(r)),o.has(fp)&&(s.forecastTs=A),o.has(hp)&&(s.nowcastingAlt=i),s.shouldIgnorePromises=!1,(o.has(fp)||o.has(hp))&&1===o.size&&(s.shouldIgnorePromises=!0),this.#P=s,!this.#k)return;this.#O.run(this.#V.bind(this))}catch(r){const A=new lA("Failed to update config for OneLayerFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}const vp={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},Ep={DATA:"/observations/v5/hexagons/{resolution}/{hexId}"},wp=5,bp=52,Ip={[ph.SMALL]:1,[ph.MEDIUM]:0,[ph.LARGE]:0,[ph.CORRIDOR]:1},Cp={[ph.SMALL]:0,[ph.MEDIUM]:1,[ph.LARGE]:1,[ph.CORRIDOR]:1},xp={[ph.SMALL]:2,[ph.MEDIUM]:1,[ph.LARGE]:2.5,[ph.CORRIDOR]:1},Np="polygon",Sp="isCorridorMode",Dp="aircraftCategory",Lp="historyHours",Tp="maxAltitude",Mp="minAltitude",Op="minSeverity",Rp={getNowcastingDataSlice:({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{forecast:n=Th.FORECAST,severity:r=Th.SEVERITY,altitude:A=Th.ALTITUDE}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({forecast:t})=>t===n)).filter((({alt:t})=>t===A)).filter((({sev:t})=>t>=r))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},prepareNowcastingDataForMapHexagons:({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.flatMap((({hexIds:n,...r})=>n.map((n=>{let A;try{A=$A(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:A,...r}})))).filter(Boolean)))}},Pp={availableConfigInputs:{aircraftCategory:vp,hours:{halfAnHour:"0.5",oneHour:"1",twoHours:"2",threeHours:"3",fourHours:"4"},severity:{smooth:0,light:1,lightModerate:2,moderate:3,moderateSevere:4},maxAltitude:52,minAltitude:5,largePolygonHandlingBehavior:{IGNORE:"ignore",USE_MIDDLE_AREA:"loadMiddleArea",EXCLUDE_SMOOTH_SEVERITY:"excludeSmoothSeverity"}}},kp=(t,e,n={},r)=>{const{childCells:A}=n,i=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:r}=e;if(!A?.length)return[n,r];const i=r.filter((t=>{const{hexId:e}=t,r=$A(e,n,5);return A.includes(r)}));return[n,i]})),o=Object.fromEntries(i),{historyHours:s,maxAltitude:a,minAltitude:u,minSeverity:c}=r,l=uh({data:o,filters:{hoursAgo:s,altitudeFrom:u,altitudeTo:a,severity:c}});return{toRawObject:()=>l,toHexagonsArray:()=>ch({data:l}),toFeatureCollection:()=>{const t=ch({data:l}),e=ih({hexagons:t});return Ah(Object.values(e))}}},Bp=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]})))};class Fp{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async({polygon:t,polygonSize:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o},s)=>{if(!t||!e)return null;const a={historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o},u=Cp[e],{hexIds:c,childCells:l}=(({polygon:t,polygonSize:e})=>{let n=t;const r=Ip[e],A=xp[e];let i,o;switch(e){case ph.LARGE:n=vh({polygon:n,resolution:r,extensionFactor:A});break;case ph.CORRIDOR:{o=WA(n,5,!0);const t=t=>XA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=fh({polygon:n,resolution:r,extensionFactor:A})}return i??=WA(n,r,!0),{hexIds:i,childCells:o}})({polygon:t,polygonSize:e});e===ph.LARGE&&[...this.#L.keys()].forEach((t=>!c.includes(t.split(",")[0])&&this.#L.delete(t)));const f=c.filter((t=>{const r=String([t,e,u,n]);if(!this.#L.has(r))return!0;const A=this.#L.get(r),{fetchedAt:i,updatedAt:o}=A,s=ai().unix()-i,a=ai().unix()-o;return!(s<60)&&!(a<60)}));if(!f.length)return kp(this.#L,[e,u,n],{childCells:l},a);const h=f.map((t=>{const r=Ep.DATA.replace("{hexId}",t).replace("{resolution}",String(Ip[e])),A=String([t,e,u,n]),i=this.#L.get(A)?.updatedAt;return this.#t({path:r,method:Br,params:{minSev:u,hoursAgo:4,maxAlt:bp,minAlt:wp,acCat:n,since:i},signal:s})}));return(await Promise.allSettled(h)).forEach(((t,r)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const A={fetchedAt:ai().unix(),reports:Bp(t),updatedAt:t.value.data?.updatedAt},i=f[r],o=String([i,e,u,n]),s=this.#L.get(o);if(!!s?.updatedAt&&!!s?.reports?.length&&s?.updatedAt!==A.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,n=s.reports,r=A.reports;n.forEach((n=>t.set(e(n),n))),r.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),a={fetchedAt:A.fetchedAt,updatedAt:A.updatedAt,reports:i};this.#L.set(o,a)}else this.#L.set(o,A)})),[...this.#L.keys()].forEach((t=>!t.includes(e)&&this.#L.delete(t))),kp(this.#L,[e,u,n],{childCells:l},a)};expire=()=>{const t=[...this.#L.entries()],e=ai().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class Gp{constructor({fetcher:t}){this.#T=new Fp({fetcher:t}),this.#M=new AbortController,this.#O=ni(500),this.#R=ni(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1,aircraftCategory:vp.C60,historyHours:2,maxAltitude:52,minAltitude:5,minSeverity:0}}#P;#T;#M;#k;#B;#F;#O;#R;#G;#U;#Q;#V=async()=>{if(this.#k)try{this.#T.expire(),this.#B&&(this.#M.abort(jr),this.#M=new AbortController,this.#z(null));const t=this.#T.fetch(this.#P,this.#M.signal);this.#z(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new lA("Failed to run Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#z(null),this.#k&&this.#R.run(this.#V.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(jr),this.#M=new AbortController,this.#z(null)}catch(t){const e=new lA("Failed to stop Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#z=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!ti(t))throw new sA(eA);this.#G=t};onError=t=>{if(!ti(t))throw new sA(eA);this.#U=t};onIsProcessingChange=t=>{if(!ti(t))throw new sA(eA);this.#Q=t};start=()=>{this.#k=!0,this.#V()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{if(!JA(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(!JA(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!JA(n)){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(vp).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!JA(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(!JA(A)){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<0||A>52)throw new Error("maxAltitude must be a number between 0 and 52")}if(!JA(i)){if("number"!=typeof i)throw new Error("minAltitude must be a number");if(i<0||i>52)throw new Error("minAltitude must be a number between 0 and 52")}if(!JA(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:A,minAltitude:i,minSeverity:o});const s=Ai({current:this.#P,next:{polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o}}),a={...this.#P};if(s.has(Sp)&&(a.isCorridorMode=e),s.has(Np)&&(a.polygon=t,a.polygonSize=a.isCorridorMode?ph.CORRIDOR:gh(t)),s.has(Dp)&&(a.aircraftCategory=n),s.has(Lp)&&(a.historyHours=r),s.has(Tp)&&(a.maxAltitude=A),s.has(Mp)&&(a.minAltitude=i),s.has(Op)&&(a.minSeverity=o),this.#P=a,!this.#k)return;this.#O.run(this.#V.bind(this))}catch(r){const A=new lA("Failed to update config for ObservationsFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}exports.CoreUtils=ii,exports.GeoUtils=Eh,exports.Nowcasting=Rp,exports.Observations=Pp,exports.default=async({apiKey:t,userId:e,companyName:n,authCallback:r,environment:A=$r,proxyUrl:i,applicationId:o,isMonitoringEnabled:s=!0,shouldCollectConsoleLogs:a=!1,shouldCollectErrors:u=!1})=>{try{const c=new Qh({environment:A,proxyUrl:i}),{fetcher:l,me:f}=await c.authenticate({apiKey:t,userId:e,companyName:n,authCallback:r});(({isEnabled:t,collectConsole:e,collectErrors:n,applicationId:r,environment:A,companyId:i,userId:o})=>{t&&A?.toLowerCase()!==Hr&&(kr.init({clientToken:"pub0b945dd1505a74367a4f900219c56210",service:"skypath-web-sdk",site:"datadoghq.com",env:A,version:Zr,forwardErrorsToLogs:n,forwardConsoleLogs:e?"all":[],sessionSampleRate:100,beforeSend:t=>{switch(t.origin){case"logger":{const e=t.logger?.name||"unknown-logger",n={[Jr]:tA.SDK}[e]||`[${e}]`;return t.message=`${n} ${t.message}`,!0}case"network":{const e=t?.http?.status_code;return 0!==e||(t.message=[tA.NETWORK,t.message].join(" ")),!0}default:return!1}}}),kr.setGlobalContext({applicationId:r,companyId:i,userId:o}),kr.createLogger(Jr,{level:"info",handler:"http",context:{applicationId:r}}))})({isEnabled:s,collectConsole:a,collectErrors:u,applicationId:o,environment:A,companyId:f?.companyId,userId:f?.userId});const h=new kh({fetcher:l}),p=await h.getMapping(),d=new hA({fetcher:l}),g=new Rh({fetcher:l}),y=new Gh({fetcher:l});return{createNowcastingFlow:()=>new Oh({cacheTokenService:y,nowcastingService:g}),createGtgFlow:()=>new Oh({cacheTokenService:y,nowcastingService:d}),createObservationsFlow:()=>new Gp({fetcher:l}),createOneLayerFlow:()=>new mp({fetcher:l}),createAdsbFlow:()=>new Jh({fetcher:l}),mapAircraftIcaoToAircraftType:({icao:t})=>ZA({icao:t,mapping:p})}}catch(t){throw new uA(t.message,{error:t})}};
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},e=console,n={};Object.keys(t).forEach((t=>{n[t]=e[t]}));const r="Datadog Browser SDK:",A={debug:n.debug.bind(e,r),log:n.log.bind(e,r),info:n.info.bind(e,r),warn:n.warn.bind(e,r),error:n.error.bind(e,r)},i="https://docs.datadoghq.com",o=`${i}/real_user_monitoring/browser/troubleshooting`,s="More details:";function a(t,e){return(...n)=>{try{return t(...n)}catch(t){A.error(e,t)}}}function u(t){return 0!==t&&100*Math.random()<=t}const c=1e3,l=60*c,f=60*l,h=365*(24*f);function p(){return(new Date).getTime()}function d(){return p()}function g(){return performance.now()}function y(){return{relative:g(),timeStamp:d()}}let _;function m(){return void 0===_&&(_=performance.timing.navigationStart),_}const v=1024,E=1024*v,w=/[^\u0000-\u007F]/;function b(t){return w.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function I(t,e){return Object.keys(t).some((n=>t[n]===e))}function C(t){return 0===Object.keys(t).length}function x(){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}function N(t,e){const n=x();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let S,D=!1;function L(t){D=t}function T(t){return function(){return M(t,this,arguments)}}function M(t,e,n){try{return t.apply(e,n)}catch(t){!function(t){if(O(t),S)try{S(t)}catch(t){O(t)}}(t)}}function O(...t){D&&A.error("[MONITOR]",...t)}function R(t,e){return N(x(),"setTimeout")(T(t),e)}function P(t){N(x(),"clearTimeout")(t)}function k(t,e){return N(x(),"setInterval")(T(t),e)}function B(t){N(x(),"clearInterval")(t)}class F{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function G(...t){return new F((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function U(t,e,n){let r,A,i=!1;return{throttled:(...n)=>{i?r=n:(t(...n),i=!0,A=R((()=>{r&&t(...r),i=!1,r=void 0}),e))},cancel:()=>{P(A),i=!1,r=void 0}}}function Q(){}function z(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,z)}const V=/([\w-]+)\s*=\s*([^;]+)/g;function q(t,e,n=""){const r=t.charCodeAt(e-1),A=r>=55296&&r<=56319?e+1:e;return t.length<=A?t:`${t.slice(0,A)}${n}`}function Y(){return 0===(null!=j?j:j=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 j,H,X;function $(t,e,n=0,r){const A=new Date;A.setTime(A.getTime()+n);const i=`expires=${A.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};${i};path=/;samesite=${o}${s}${a}${u}`}function W(t){return function(t,e){for(V.lastIndex=0;;){const n=V.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function K(t){return H||(H=function(t){const e=new Map;for(V.lastIndex=0;;){const n=V.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),H.get(t)}function Z(t,e){$(t,"",0,e)}const J="_dd_s";function tt(t){return Object.values(t)}function et(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function nt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const rt=4*f,At=15*l,it=h,ot={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},st=/^([a-zA-Z]+)=([a-z0-9-]+)$/,at="&";const ut="1";function ct(t,e){const n={isExpired:ut};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function lt(t){return C(t)}function ft(t){return!lt(t)}function ht(t){return void 0!==t.isExpired||!((void 0===(e=t).created||p()-Number(e.created)<rt)&&(void 0===e.expire||p()<Number(e.expire)));var e}function pt(t){t.expire=String(p()+At)}function dt(t){return(e=t,Object.entries(e)).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join(at);var e}function gt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf(at)||st.test(t))}(t)&&t.split(at).forEach((t=>{const n=st.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}const yt="_dd",_t="_dd_r",mt="_dd_l",vt="rum",Et="logs";function wt(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===X){const t=`dd_site_test_${z()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!W(t);)r=`${n.pop()}.${r}`,$(t,e,c,{domain:r});Z(t,{domain:r}),X=r}return X}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${z()}`,n="test";$(e,n,l,t);const r=W(e)===n;return Z(e,t),r}catch(t){return A.error(t),!1}}(e)?{type:ot.COOKIE,cookieOptions:e}:void 0}function bt(t,e){const n={isLockEnabled:Y(),persistSession:(r=e,t=>{$(J,dt(t),At,r)}),retrieveSession:It,expireSession:n=>function(t,e,n){const r=ct(e,n);$(J,dt(r),n.trackAnonymousUser?it:rt,t)}(e,n,t)};var r;return function(t){if(!K(J)){const e=K(yt),n=K(_t),r=K(mt),A={};e&&(A.id=e),r&&/^[01]$/.test(r)&&(A[Et]=r),n&&/^[012]$/.test(n)&&(A[vt]=n),ft(A)&&(pt(A),t.persistSession(A))}}(n),n}function It(){return gt(W(J))}const Ct="_dd_test_";function xt(){try{const t=z(),e=`${Ct}${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:ot.LOCAL_STORAGE}:void 0}catch(t){return}}function Nt(t){return{isLockEnabled:!1,persistSession:St,retrieveSession:Dt,expireSession:e=>function(t,e){St(ct(t,e))}(e,t)}}function St(t){localStorage.setItem(J,dt(t))}function Dt(){return gt(localStorage.getItem(J))}const Lt=10,Tt=100,Mt=[];let Ot;function Rt(t,e,n=0){var r;const{isLockEnabled:A,persistSession:i,expireSession:o}=e,s=t=>i({...t,lock:u}),a=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Ot||(Ot=t),t!==Ot)return void Mt.push(t);if(A&&n>=Tt)return void kt(e);let u,c=a();if(A){if(c.lock)return void Pt(t,e,n);if(u=z(),s(c.session),c=a(),c.lock!==u)return void Pt(t,e,n)}let l=t.process(c.session);if(A&&(c=a(),c.lock!==u))Pt(t,e,n);else{if(l&&(ht(l)?o(l):(pt(l),A?s(l):i(l))),A&&(!l||!ht(l))){if(c=a(),c.lock!==u)return void Pt(t,e,n);i(c.session),l=c.session}null===(r=t.after)||void 0===r||r.call(t,l||c.session),kt(e)}}function Pt(t,e,n){R((()=>{Rt(t,e,n+1)}),Lt)}function kt(t){Ot=void 0;const e=Mt.shift();e&&Rt(e,t)}const Bt=c;function Ft(t){switch(t.sessionPersistence){case ot.COOKIE:return wt(t);case ot.LOCAL_STORAGE:return xt();case void 0:{let e=wt(t);return!e&&t.allowFallbackToLocalStorage&&(e=xt()),e}default:A.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Gt(t,e,n,r){const A=new F,i=new F,o=new F,s=t.type===ot.COOKIE?bt(e,t.cookieOptions):Nt(e),{expireSession:a}=s,u=k((function(){Rt({process:t=>ht(t)?ct(t,e):void 0,after:h},s)}),Bt);let c;d();const{throttled:l,cancel:f}=U((()=>{Rt({process:t=>{if(lt(t))return;const e=h(t);return function(t){if(lt(t))return!1;const{trackingType:e,isTracked:A}=r(t[n]);t[n]=e,delete t.isExpired,A&&!t.id&&(t.id=z(),t.created=String(p()))}(e),e},after:t=>{ft(t)&&!g()&&function(t){c=t,A.notify()}(t),c=t}},s)}),Bt);function h(t){return ht(t)&&(t=ct(t,e)),g()&&(!function(t){return c.id!==t.id||c[n]!==t[n]}(t)?(o.notify({previousState:c,newState:t}),c=t):(c=ct(c,e),i.notify())),t}function d(){Rt({process:t=>{if(lt(t))return ct(t,e)},after:t=>{c=t}},s)}function g(){return void 0!==c[n]}return{expandOrRenewSession:l,expandSession:function(){Rt({process:t=>g()?h(t):void 0},s)},getSession:()=>c,renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o,restartSession:d,expire:()=>{f(),a(c),h(ct(c,e))},stop:()=>{B(u)},updateSessionState:function(t){Rt({process:e=>({...e,...t}),after:h},s)}}}const Ut={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Qt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=zt(Object.prototype),A=zt(Array.prototype),i=zt(Object.getPrototypeOf(t)),o=zt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),A(),i(),o()}}function zt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):Q}function Vt(t){return function(t,e){const n=function(){if(void 0===Yt)try{const t=new qt("http://test/path");Yt="http://test/path"===t.href}catch(t){Yt=!1}return Yt?qt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${Qt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const A=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(A)}return A.href=t,A}(t,location.href).href}const qt=URL;let Yt;const jt="datad0g.com",Ht="dd0g-gov.com",Xt="datadoghq.com",$t="pci.browser-intake-datadoghq.com",Wt=["ddsource","ddtags"];function Kt(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=Vt(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const A=function(t,e){const{site:n=Xt,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===Xt)return $t;if(r&&n===Xt)return`${r}.${Xt}`;if(n===Ht)return`http-intake.logs.${n}`;const A=n.split("."),i=A.pop();return`browser-intake-${A.join("-")}.${i}`}(e,t);return t=>`https://${A}${n}?${t}`}(t,e);return{build(A,i){const o=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,A,{retry:i,encoding:o}){const s=["sdk_version:6.0.0",`api:${A}`].concat(r);i&&s.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const a=["ddsource=browser",`ddtags=${encodeURIComponent(s.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${z()}`];o&&a.push(`dd-evp-encoding=${o}`);"rum"===n&&a.push(`batch_time=${d()}`);e&&a.reverse();return a.join("&")}(t,e,n,A,i);return r(o)},urlPrefix:r(""),trackType:e}}const Zt=200;function Jt(t,e){const n=Zt-t.length-1;(e.length>n||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)}(e))&&A.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${s} ${i}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function te(t){const e=t.site||Xt,n=function(t){const{env:e,service:n,version:r,datacenter:A}=t,i=[];return e&&i.push(Jt("env",e)),n&&i.push(Jt("service",n)),r&&i.push(Jt("version",r)),A&&i.push(Jt("datacenter",A)),i}(t),r=function(t,e){return{logsEndpointBuilder:Kt(t,"logs",e),rumEndpointBuilder:Kt(t,"rum",e),sessionReplayEndpointBuilder:Kt(t,"replay",e)}}(t,n),A=function(t,e){if(!t.replica)return;const n={...t,site:Xt,clientToken:t.replica.clientToken},r={logsEndpointBuilder:Kt(n,"logs",e),rumEndpointBuilder:Kt(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:A,site:e,...r}}function ee(t,e){return null==t||"string"==typeof t||(A.error(`${e} must be defined as a string`),!1)}function ne(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(A.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function re(t){var e,n,r,o,u,l;if(t&&t.clientToken){if((!(f=t.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(A.error(`Site should be a valid Datadog site. ${s} ${i}/getting_started/site/.`),0))&&ne(t.sessionSampleRate,"Session")&&ne(t.telemetrySampleRate,"Telemetry")&&ne(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&ne(t.telemetryUsageSampleRate,"Telemetry Usage")&&ee(t.version,"Version")&&ee(t.env,"Env")&&ee(t.service,"Service")){var f;if(void 0===t.trackingConsent||I(Ut,t.trackingConsent))return{beforeSend:t.beforeSend&&a(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Ft(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(o=t.telemetryUsageSampleRate)&&void 0!==o?o:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(u=t.trackingConsent)&&void 0!==u?u:Ut.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16*v,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*c,batchMessagesLimit:50,messageBytesLimit:256*v,...te(t)};A.error('Tracking Consent should be either "granted" or "not-granted"')}}else A.error("Client Token is not configured, we will not send any data.")}var Ae;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(Ae||(Ae={}));const ie=new Set;function oe(t){Array.isArray(t)&&t.filter((t=>I(Ae,t))).forEach((t=>{ie.add(t)}))}function se(){return ie}const ae="?";function ue(t){const e=[];let n=_e(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=fe.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),A=he.exec(e[2]);r&&A&&(e[2]=A[1],e[3]=A[2],e[4]=A[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||ae,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=pe.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:ae,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=de.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||ae,line:+e[3],url:e[2]}}(t)||function(t){const e=ge.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=ye.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]||ae,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=ae),e.push(n))})),{message:_e(t,"message"),name:_e(t,"name"),stack:e}}const ce="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",le="(?::(\\d+))",fe=new RegExp(`^\\s*at (.*?) ?\\(${ce}${le}?${le}?\\)?\\s*$`,"i"),he=new RegExp(`\\((\\S*)${le}${le}\\)`);const pe=new RegExp(`^\\s*at ?${ce}${le}?${le}??\\s*$`,"i");const de=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const ge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ye=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function _e(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function me(t,e,n,r){const A=[{url:e,column:r,line:n}],{name:i,message:o}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=ve.exec(t));return{name:e,message:n}}(t);return{name:i,message:o,stack:A}}const ve=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Ee(){const t=new Error;let e;return M((()=>{const n=ue(t);n.stack=n.stack.slice(2),e=we(n)})),e}function we(t){let e=be(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",A=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${A}${i}`})),e}function be(t){return`${t.name||"Error"}: ${t.message}`}function Ie(t,e,n,{computeHandlingStack:r}={}){let A=t[e];if("function"!=typeof A){if(!(e in t)||!e.startsWith("on"))return{stop:Q};A=Q}let i=!1;const o=function(){if(i)return A.apply(this,arguments);const t=Array.from(arguments);let e;M(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Ee():void 0}]);const o=A.apply(this,t);return e&&M(e,null,[o]),o};return t[e]=o,{stop:()=>{i=!0,t[e]===o&&(t[e]=A)}}}const Ce=220*v,xe="$",Ne=3;function Se(t,e=Ce){const n=zt(Object.prototype),r=zt(Array.prototype),A=[],i=new WeakMap,o=De(t,xe,void 0,A,i),s=JSON.stringify(o);let a=s?s.length:0;if(!(a>e)){for(;A.length>0&&a<e;){const n=A.shift();let r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){const s=De(n.source[o],n.path,o,A,i);if(a+=void 0!==s?JSON.stringify(s).length:4,a+=r,r=1,a>e){Te(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=De(n.source[o],n.path,o,A,i);if(void 0!==s&&(a+=JSON.stringify(s).length+r+o.length+Ne,r=1),a>e){Te(e,"truncated",t);break}n.target[o]=s}}return n(),r(),o}Te(e,"discarded",t)}function De(t,e,n,r,A){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)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}(i);const o=Le(i);if("[Object]"!==o&&"[Array]"!==o&&"[Error]"!==o)return o;const s=t;if(A.has(s))return`[Reference seen at ${A.get(s)}]`;const a=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return A.set(s,a),r.push({source:i,target:u,path:a}),u}function Le(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Le(e.currentTarget):null,target:e.target?Le(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 Te(t,e,n){A.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Me="No stack, consider using an instance of Error";function Oe({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:A,source:i,handling:o}){const s=Pe(e),a=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${Qt(Se(r))}`}(t,s,A,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(s,t)?we(t):Me,c=s?ke(e,i):void 0;return{startClocks:r,source:i,handling:o,handlingStack:n,originalError:e,type:t?t.name:void 0,message:a,stack:u,causes:c,fingerprint:Re(e)}}function Re(t){return Pe(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function Pe(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function ke(t,e){let n=t;const r=[];for(;Pe(null==n?void 0:n.cause)&&r.length<10;){const t=ue(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&we(t)}),n=n.cause}return r.length?r:void 0}const Be={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Fe(t){const e=(e,n)=>{const r=Oe({stackTrace:e,originalError:n,startClocks:y(),nonErrorPrefix:"Uncaught",source:Be.SOURCE,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ie(window,"onerror",(({parameters:[t,e,n,A,i]})=>{let o;o=Pe(i)?ue(i):me(t,e,n,A),r(o,null!=i?i:t)})));var r;const{stop:A}=function(t){return Ie(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=ue(n);t(r,n)}))}(e);return{stop:()=>{n(),A()}}}function Ge(t,e){e.silentMultipleInit||A.error(`${t} is already initialized.`)}function Ue(t,e,n,r,A){return Qe(t,e,[n],r,A)}function Qe(t,e,n,r,{once:A,capture:i,passive:o}={}){const s=T((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(A&&l(),r(e))})),a=o?{capture:i,passive:o}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,c=N(u,"addEventListener");function l(){const t=N(u,"removeEventListener");n.forEach((n=>t.call(e,n,s,a)))}return n.forEach((t=>c.call(e,t,s,a))),{stop:l}}const ze={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Ve(t,e){const n=[];e.includes(ze.cspViolation)&&n.push(function(t){return new F((e=>{const{stop:n}=Ue(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return qe({type:t.effectiveDirective,message:`${ze.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:Ye(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${q(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==ze.cspViolation));return r.length&&n.push(function(t){return new F((e=>{if(!window.ReportingObserver)return;const n=T(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return qe({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:Ye(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)),G(...n)}function qe(t){return{startClocks:y(),source:Be.REPORT,handling:"unhandled",...t}}function Ye(t,e,n,r,A){return n?we({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=A?A:void 0}]}):void 0}function je(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function He(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]=He(r[t],e[t],n);return r}const r="object"===et(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=He(r[t],e[t],n));return r}function Xe(t){return He(void 0,t)}function $e(...t){let e;for(const n of t)null!=n&&(e=He(e,n));return e}function We(){var t;const e=window.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 Ke(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const Ze=500;function Je(){const t=[];return{add:e=>{t.push(e)>Ze&&t.splice(0,1)},remove:e=>{Ke(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const tn={log:"log",configuration:"configuration",usage:"usage"},en=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],nn=["ddog-gov.com"];let rn=Je(),An=t=>{rn.add((()=>An(t)))};function on(t,e){let n;const r=new F,A=new Set,i=!nn.includes(e.site)&&u(e.telemetrySampleRate),o={[tn.log]:i,[tn.configuration]:i&&u(e.telemetryConfigurationSampleRate),[tn.usage]:i&&u(e.telemetryUsageSampleRate)},s={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return An=i=>{const a=Qt(i);if(o[i.type]&&A.size<e.maxTelemetryEventsPerPage&&!A.has(a)){const e=function(t,e,r){return $e({type:"telemetry",date:d(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:$e(e,{runtime_env:r,connectivity:We(),sdk_setup:"npm"}),experimental_features:Array.from(se())},void 0!==n?n():{})}(t,i,s);r.notify(e),je("telemetry",e),A.add(a)}},S=an,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function sn(e,n){O(t.debug,e,n),An({type:tn.log,message:e,status:"debug",...n})}function an(t,e){An({type:tn.log,status:"error",...un(t),...e})}function un(t){if(Pe(t)){const e=ue(t);return{error:{kind:e.name,stack:we(cn(e))},message:e.message}}return{error:{stack:Me},message:`Uncaught ${Qt(t)}`}}function cn(t){return t.stack=t.stack.filter((t=>!t.url||en.some((e=>t.url.startsWith(e))))),t}const ln=1/0,fn=l;function hn({expireDelay:t,maxEntries:e}){let n=[];const r=k((()=>function(){const e=g()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),fn);return{add:function(t,r){const A={value:t,startTime:r,endTime:ln,remove:()=>{Ke(n,A)},close:t=>{A.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(A),A},find:function(t=ln,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===ln&&e.close(t)},findAll:function(t=ln,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(){B(r)}}}const pn=l,dn=rt;function gn(t,e,n,r){const A=new F,i=new F,o=Gt(t.sessionStoreStrategyType,t,e,n),s=hn({expireDelay:dn});function a(){return{id:o.getSession().id,trackingType:o.getSession()[e],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return o.renewObservable.subscribe((()=>{s.add(a(),g()),A.notify()})),o.expireObservable.subscribe((()=>{i.notify(),s.closeActive(g())})),o.expandOrRenewSession(),s.add(a(),[0,m()][0]),r.observable.subscribe((()=>{r.isGranted()?o.expandOrRenewSession():o.expire()})),function(t,e){Qe(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()};Ue(t,document,"visibilitychange",n),k(n,pn)}(t,(()=>o.expandSession())),function(t,e){Ue(t,window,"resume",e,{capture:!0})}(t,(()=>o.restartSession())),{findSession:(t,e)=>s.find(t,e),renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function yn(t){return t>=500}const _n=80*v,mn=32,vn=3*E,En=l,wn=c;function bn(t,e,n,r,A){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Cn(t,e,n,{onSuccess:()=>xn(0,e,n,r,A),onFailure:()=>{e.queuedPayloads.enqueue(t),In(e,n,r,A)}}):e.queuedPayloads.enqueue(t)}function In(t,e,n,r){2===t.transportStatus&&R((()=>{Cn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=wn,xn(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(En,2*t.currentBackoffTime),In(t,e,n,r)}})}),t.currentBackoffTime)}function Cn(t,e,n,{onSuccess:r,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||yn(t.status))}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},A())}))}function xn(t,e,n,r,A){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(A({message:`Reached max ${r} events size queued for upload: ${vn/E}MiB`,source:Be.AGENT,startClocks:y()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Nn();i.size()>0;)bn(i.dequeue(),e,n,r,A)}function Nn(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=vn}}}function Sn(t,e,n){const r={transportStatus:0,currentBackoffTime:wn,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=_n&&this.ongoingRequestCount<mn},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Nn(),queueFullReported:!1},A=(n,r)=>function(t,e,n,r){const A=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(A){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(T((t=>null==r?void 0:r({status:t.status,type:t.type}))),T((()=>{Ln(t.build("xhr",n),n.data,r)})))}else{Ln(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{bn(e,r,A,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Dn||(Dn=!0,an(t))}(t)}const A=t.build("xhr",n);Ln(A,n.data)}(t,e,n)}}}let Dn=!1;function Ln(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Ue({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Tn(){const t=x().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 A=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:A}))}}}function Mn(t){var e;void 0===t&&(t=null===(e=x().location)||void 0===e?void 0:e.hostname);const n=Tn();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const On={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Rn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let i={};const a=n.flushObservable.subscribe((n=>function(n){const r=tt(i).join("\n");i={};const A=(s=n.reason,tt(On).includes(s)),o=A?e.sendOnExit:e.send;var s;if(A&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&o(Pn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&o({data:n,bytesCount:b(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{o(Pn(t))}))}(n)));function u(e,a){const u=Qt(e),c=t.estimateEncodedBytesCount(u);c>=r?A.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${s} ${o}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==i[t]}(a)&&function(e){const r=i[e];delete i[e];const A=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(A)}(a),function(e,r,A){n.notifyBeforeAddMessage(r),void 0!==A?(i[A]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,c,a))}return{flushController:n,add:u,upsert:u,stop:a.unsubscribe}}function Pn(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}}function kn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:A}){const i=r.subscribe((t=>l(t.reason))),o=A.subscribe((()=>l("session_expire"))),s=new F((()=>()=>{i.unsubscribe(),o.unsubscribe()}));let a,u=0,c=0;function l(t){if(0===c)return;const e=c,n=u;c=0,u=0,f(),s.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){P(a),a=void 0}return{flushObservable:s,get messagesCount(){return c},notifyBeforeAddMessage(t){u+t>=e&&l("bytes_limit"),c+=1,u+=t,void 0===a&&(a=R((()=>{l("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,c>=t?l("messages_limit"):u>=e&&l("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,c-=1,0===c&&f()}}}function Bn(t,e,n,r,A,i,o=Rn){const s=u(t,e),a=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return o({encoder:n,request:Sn(e,t.batchBytesLimit,r),flushController:kn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:A,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add(t,e=!0){s.add(t),a&&e&&a.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{s.upsert(t,e),a&&a.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{s.stop(),a&&a.stop()}}}function Fn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const A=b(n);e+=A,t+=n,r&&r(A)},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 Gn;const Un=new WeakMap;function Qn(t){return Gn||(Gn=function(t){return new F((e=>{const{stop:n}=Ie(XMLHttpRequest.prototype,"open",zn),{stop:r}=Ie(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const A=Un.get(t);if(!A)return;const i=A;i.state="start",i.startClocks=y(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let o=!1;const{stop:s}=Ie(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&a()})),a=()=>{if(u(),s(),o)return;o=!0;const e=A;var n,a;e.state="complete",e.duration=(n=i.startClocks.timeStamp,d()-n),e.status=t.status,r.notify((a=e,{...a}))},{stop:u}=Ue(n,t,"loadend",a);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:A}=Ie(XMLHttpRequest.prototype,"abort",Vn);return()=>{n(),r(),A()}}))}(t)),Gn}function zn({target:t,parameters:[e,n]}){Un.set(t,{state:"open",method:String(e).toUpperCase(),url:Vt(String(n))})}function Vn({target:t}){const e=Un.get(t);e&&(e.isAborted=!0)}let qn;function Yn(){return qn||(qn=new F((t=>{if(!window.fetch)return;const{stop:e}=Ie(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[A,i]=t;let o=i&&i.method;void 0===o&&A instanceof Request&&(o=A.method);const s=void 0!==o?String(o).toUpperCase():"GET",a=A instanceof Request?A.url:Vt(String(A)),u=y(),c={state:"start",init:i,input:A,method:s,startClocks:u,url:a,handlingStack:n};r.notify(c),t[0]=c.input,t[1]=c.init,e((t=>function(t,e,n){const r=n;function A(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(T((t=>{A({response:t,responseType:t.type,status:t.status,isAborted:!1})})),T((t=>{var e,n;A({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,c)))}(e,t)),{computeHandlingStack:!0});return e}))),qn}let jn={};function Hn(n){return G(...n.map((n=>(jn[n]||(jn[n]=function(n){return new F((r=>{const A=e[n];return e[n]=(...e)=>{A.apply(console,e);const i=Ee();M((()=>{r.notify(function(e,n,r){const A=e.map((t=>function(t){if("string"==typeof t)return Se(t);if(Pe(t))return be(ue(t));return Qt(Se(t),void 0,2)}(t))).join(" ");let i;if(n===t.error){const t=e.find(Pe);i={stack:t?we(ue(t)):void 0,fingerprint:Re(t),causes:t?ke(t,"console"):void 0,startClocks:y(),message:A,source:Be.CONSOLE,handling:"handled",handlingStack:r}}return{api:n,message:A,error:i,handlingStack:r}}(e,n,i))}))},()=>{e[n]=A}}))}(n)),jn[n]))))}function Xn(t){let e={};const n=new F,r={getContext:()=>Xe(e),setContext:A=>{"object"===et(A)?(e=Se(A),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,A)=>{e[r]=Se(A),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const $n="_dd_c",Wn=[];function Kn(t,e,n,r){const A=function(t,e){return`${$n}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(A);return null!==t?JSON.parse(t):{}}Wn.push(Ue(t,window,"storage",(({key:t})=>{A===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(A,JSON.stringify(e.getContext()))})),e.setContext($e(i(),e.getContext()))}const Zn=3*v,Jn=16*v,tr=200;function er(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const i=2===t?Zn:Jn;let a=r;e.forEach((t=>{a+=t.getBytesCount()})),a>i&&(!function(t){A.warn(`Customer data exceeds the recommended ${t/v}KiB threshold. ${s} ${o}/#customer-data-exceeds-the-recommended-threshold-warning`)}(i),n=!0)}return{createDetachedTracker:()=>{const t=nr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,nr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function nr(t){let e=0;const{throttled:n,cancel:r}=U((n=>{e=b(Qt(n)),t()}),tr),A=()=>{r(),e=0};return{updateCustomerData:t=>{C(t)?A():n(t)},resetCustomerData:A,getBytesCount:()=>e,stop:()=>{r()}}}const rr="datadog-synthetics-public-id",Ar="datadog-synthetics-result-id",ir="datadog-synthetics-injects-rum";function or(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||K(ir))}function sr(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||K(rr);return"string"==typeof t?t:void 0}function ar(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||K(Ar);return"string"==typeof t?t:void 0}function ur(t,e,n){const r=n.getHandler(),A=Array.isArray(r)?r:[r];return lr[t]>=lr[n.getLevel()]&&A.includes(e)}const cr={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},lr={[cr.ok]:0,[cr.debug]:1,[cr.info]:2,[cr.notice]:4,[cr.warn]:5,[cr.error]:6,[cr.critical]:7,[cr.alert]:8,[cr.emerg]:9};function fr(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 hr=function(t,e,n,r){var A,i=arguments.length,o=i<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--)(A=t[s])&&(o=(i<3?A(o):i>3?A(e,n,o):A(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const pr={console:"console",http:"http",silent:"silent"},dr=Object.keys(cr);class gr{constructor(t,e,n,r=pr.http,A=cr.debug,i={}){this.handleLogStrategy=t,this.handlerType=r,this.level=A,this.contextManager=Xn(e),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}logImplementation(t,e,n=cr.info,r,A){const i=Se(e);let o;if(null!=r){o=$e({error:fr(Oe({stackTrace:Pe(r)?ue(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Be.LOGGER,handling:"handled",startClocks:y()}),{includeMessage:!0})},i)}else o=i;this.handleLogStrategy({message:Se(t),context:o,status:n},this,A)}log(t,e,n=cr.info,r){let A;ur(n,pr.http,this)&&(A=Ee()),this.logImplementation(t,e,n,r,A)}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()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function yr(t){return function(e,n,r){let A;ur(t,pr.http,this)&&(A=Ee()),this.logImplementation(e,n,t,r,A)}}hr([function(t,e,n){const r=n.value;n.value=function(...t){return(S?T(r):r).apply(this,t)}}],gr.prototype,"logImplementation",null),gr.prototype.ok=yr(cr.ok),gr.prototype.debug=yr(cr.debug),gr.prototype.info=yr(cr.info),gr.prototype.notice=yr(cr.notice),gr.prototype.warn=yr(cr.warn),gr.prototype.error=yr(cr.error),gr.prototype.critical=yr(cr.critical),gr.prototype.alert=yr(cr.alert),gr.prototype.emerg=yr(cr.emerg);const _r=32*v;function mr(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 A.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function vr(e,n,r){const i=Je();let o,s;const a=n.observable.subscribe(u);function u(){if(!s||!o||!n.isGranted())return;a.unsubscribe();const t=r(o,s);i.drain(t)}return{init(e){if(!e)return void A.error("Missing configuration");if(oe(e.enableExperimentalFeatures),Mn()&&(e=function(t){return{...t,clientToken:"empty"}}(e)),o=e,s)return void Ge("DD_LOGS",e);const r=function(e){!0===e.usePciIntake&&e.site&&"datadoghq.com"!==e.site&&A.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=re(e),r=mr(e.forwardConsoleLogs,tt(t),"Forward Console Logs"),i=mr(e.forwardReports,tt(ze),"Forward Reports");if(n&&r&&i)return e.forwardErrorsToLogs&&!r.includes(t.error)&&r.push(t.error),{forwardErrorsToLogs:!1!==e.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:_r,...n}}(e);r&&(s=r,Yn().subscribe(Q),n.tryToInit(r.trackingConsent),u())},get initConfiguration(){return o},getInternalContext:Q,handleLog(t,n,r,A=e(),o=d()){i.add((e=>e.handleLog(t,n,r,A,o)))}}}const Er="logs";const wr="logs";function br(t,e){const n=gn(t,wr,(e=>function(t,e){const n=function(t){return"0"===t||"1"===t}(e)?e:Ir(t);return{trackingType:n,isTracked:"1"===n}}(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}}function Ir(t){return u(t.sessionSampleRate)?"1":"0"}let Cr=!1;function xr(t){const e=window;if(or()){const t=n(e.DD_RUM_SYNTHETICS);return t||Cr||(Cr=!0,sn("Logs sent before RUM is injected by the synthetics worker",{testId:sr(),resultId:ar()})),t}return n(e.DD_RUM);function n(e){if(e&&e.getInternalContext)return e.getInternalContext(t)}}function Nr(t,e,n,r,A){const i=dr.concat(["custom"]),o={};i.forEach((t=>{o[t]=function(t,e,n){let r=0,A=!1;return{isLimitReached(){if(0===r&&R((()=>{r=0}),l),r+=1,r<=e||A)return A=!1,!1;if(r===e+1){A=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Be.AGENT,startClocks:y()})}finally{A=!1}}return!0}}}(t,e.eventRateLimiterThreshold,A)})),n.subscribe(0,(({rawLogsEvent:A,messageContext:i,savedCommonContext:s,domainContext:a})=>{var u,c;const l=A.date-m();const f=t.findTrackedSession(l);if(!t.findTrackedSession(l,{returnInactive:!0}))return;const h=s||r();f&&f.anonymousId&&!h.user.anonymous_id&&(h.user.anonymous_id=f.anonymousId);const p=$e({service:e.service,session_id:f?f.id:void 0,session:f?{id:f.id}:void 0,usr:C(h.user)?void 0:h.user,view:h.view},h.context,xr(l),A,i);!1===(null===(u=e.beforeSend)||void 0===u?void 0:u.call(e,p,a))||p.origin!==Be.AGENT&&(null!==(c=o[p.status])&&void 0!==c?c:o.custom).isLimitReached()||n.notify(1,p)}))}const Sr={[t.log]:cr.info,[t.debug]:cr.debug,[t.info]:cr.info,[t.warn]:cr.warn,[t.error]:cr.error};function Dr(t,e){if(!t.forwardErrorsToLogs)return{stop:Q};const n=Qn(t).subscribe((t=>{"complete"===t.state&&A("xhr",t)})),r=Yn().subscribe((t=>{"resolve"===t.state&&A("fetch",t)}));function A(n,r){var A;function i(t){const A={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${Tr(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:t||"Failed to load",handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:cr.error,origin:Be.NETWORK},domainContext:A})}A=r.url,Wt.every((t=>A.includes(t)))||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!yn(r.status)||("xhr"in r?function(t,e,n){"string"==typeof t.response?n(Lr(t.response,e)):n(t.response)}(r.xhr,t,i):r.response?function(t,e,n){const r=function(t){try{return t.clone()}catch(t){return}}(t);r&&r.body?window.TextDecoder?function(t,e,n){!function(t,e,n){const r=t.getReader(),A=[];let i=0;function o(){let t,o;r.cancel().catch(Q);{let e;if(1===A.length)e=A[0];else{e=new Uint8Array(i);let t=0;A.forEach((n=>{e.set(n,t),t+=n.length}))}t=e.slice(0,n.bytesLimit),o=e.length>n.bytesLimit}e(void 0,t,o)}!function t(){r.read().then(T((e=>{e.done?o():(A.push(e.value),i+=e.value.length,i>n.bytesLimit?o():t())})),T((t=>e(t))))}()}(t,((t,e,r)=>{if(t)n(t);else{let t=(new TextDecoder).decode(e);r&&(t+="..."),n(void 0,t)}}),{bytesLimit:e,collectStreamBody:!0})}(r.body,e.requestErrorResponseLengthLimit,((t,e)=>{n(t?`Unable to retrieve response: ${t}`:e)})):r.text().then(T((t=>n(Lr(t,e)))),T((t=>n(`Unable to retrieve response: ${t}`)))):n()}(r.response,t,i):r.error&&function(t,e,n){n(Lr(we(ue(t)),e))}(r.error,t,i))}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function Lr(t,e){return t.length>e.requestErrorResponseLengthLimit?`${t.substring(0,e.requestErrorResponseLengthLimit)}...`:t}function Tr(t){return"xhr"===t?"XHR":"Fetch"}const Mr=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 Or(t){return{handleLog:function(r,A,i,o,s){const a=$e(A.getContext(),r.context);if(ur(r.status,pr.console,A)&&function({status:t,message:r},A){n[Rr[t]].call(e,r,A)}(r,a),ur(r.status,pr.http,A)){const e={rawLogsEvent:{date:s||d(),message:r.message,status:r.status,origin:Be.LOGGER},messageContext:a,savedCommonContext:o};i&&(e.domainContext={handlingStack:i}),t.notify(0,e)}}}}const Rr={[cr.ok]:t.debug,[cr.debug]:t.debug,[cr.info]:t.info,[cr.notice]:t.info,[cr.warn]:t.warn,[cr.error]:t.error,[cr.critical]:t.error,[cr.alert]:t.error,[cr.emerg]:t.error};function Pr(t,e,n,r,A){const i=on("browser-logs-sdk",e);i.setContextProvider((()=>{var t,e,n,r,i,o;return{application:{id:null===(t=xr())||void 0===t?void 0:t.application_id},session:{id:null===(e=A.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(r=null===(n=xr())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(o=null===(i=xr())||void 0===i?void 0:i.user_action)||void 0===o?void 0:o.id}}}));const o=[];if(Mn()){const t=Tn(),e=i.observable.subscribe((e=>t.send("internal_telemetry",e)));o.push((()=>e.unsubscribe()))}else{const t=Bn(e,{endpoint:e.rumEndpointBuilder,encoder:Fn()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:Fn()},n,r,A.expireObservable);o.push((()=>t.stop()));const s=i.observable.subscribe((n=>t.add(n,function(t){return t.site===jt}(e))));o.push((()=>s.unsubscribe()))}return rn.drain(),function(t){An({type:tn.configuration,configuration:t})}(function(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};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}(t)),{telemetry:i,stop:()=>{o.forEach((t=>t()))}}}const kr=function(t){const e=er(),n=Xn(e.getOrCreateTracker(2)),r=Xn(e.getOrCreateTracker(1)),i=function(t){const e=new F;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Ut.GRANTED,observable:e}}();function o(){return function(t,e){return{view:{referrer:document.referrer,url:window.location.href},context:t.getContext(),user:e.getContext()}}(n,r)}let s=vr(o,i,((e,A)=>{e.storeContextsAcrossPages&&(Kn(A,n,Er,2),Kn(A,r,Er,1));const a=t(e,A,o,i);return s=function(t,e){return{init:t=>{Ge("DD_LOGS",t)},initConfiguration:t,...e}}(e,a),a}));const a={};return function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>L,enumerable:!1}),e}({logger:new gr(((...t)=>s.handleLog(...t)),e.createDetachedTracker()),init:T((t=>s.init(t))),setTrackingConsent:T((t=>{var e;i.update(t),e={feature:"set-tracking-consent",tracking_consent:t},An({type:tn.usage,usage:e})})),getGlobalContext:T((()=>n.getContext())),setGlobalContext:T((t=>n.setContext(t))),setGlobalContextProperty:T(((t,e)=>n.setContextProperty(t,e))),removeGlobalContextProperty:T((t=>n.removeContextProperty(t))),clearGlobalContext:T((()=>n.clearContext())),createLogger:T(((t,n={})=>(a[t]=new gr(((...t)=>s.handleLog(...t)),e.createDetachedTracker(),Se(t),n.handler,n.level,Se(n.context)),a[t]))),getLogger:T((t=>a[t])),getInitConfiguration:T((()=>Xe(s.initConfiguration))),getInternalContext:T((t=>s.getInternalContext(t))),setUser:T((t=>{(function(t){const e="object"===et(t);return e||A.error("Unsupported user:",t),e})(t)&&r.setContext(nt(t))})),getUser:T((()=>r.getContext())),setUserProperty:T(((t,e)=>{const n=nt({[t]:e})[t];r.setContextProperty(t,n)})),removeUserProperty:T((t=>r.removeContextProperty(t))),clearUser:T((()=>r.clearContext()))})}((function(t,e,n,r){const A=new Mr,i=[];A.subscribe(1,(t=>je("logs",t)));const o=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Be.AGENT,status:cr.error}}),sn("Error reported to customer",{"error.message":e.message})}}(A),s=function(t){return new F((e=>{const{stop:n}=Qe(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:On.HIDDEN}):"freeze"===t.type&&e.notify({reason:On.FROZEN})}),{capture:!0}),r=Ue(t,window,"beforeunload",(()=>{e.notify({reason:On.UNLOADING})})).stop;return()=>{n(),r()}}))}(e),a=!e.sessionStoreStrategyType||Mn()||or()?function(t){const e="1"===Ir(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new F}}(e):br(e,r),{stop:u}=Pr(t,e,o,s,a);i.push((()=>u())),Dr(e,A),function(t,e){if(!t.forwardErrorsToLogs)return{stop:Q};const n=new F,{stop:r}=Fe(n),A=n.subscribe((t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,error:fr(t),origin:Be.SOURCE,status:cr.error}})}))}(e,A),function(t,e){const n=Hn(t.forwardConsoleLogs).subscribe((t=>{const n={rawLogsEvent:{date:d(),message:t.message,origin:Be.CONSOLE,error:t.error&&fr(t.error),status:Sr[t.api]},domainContext:{handlingStack:t.handlingStack}};e.notify(0,n)}))}(e,A),function(t,e){const n=Ve(t,t.forwardReports).subscribe((t=>{let n,r=t.message;const A="deprecation"===t.originalError.type?cr.warn:cr.error;var i,o;A===cr.error?n=fr(t):t.stack&&(r+=` Found in ${i=t.stack,null===(o=/@ (.+)/.exec(i))||void 0===o?void 0:o[1]}`),e.notify(0,{rawLogsEvent:{date:d(),message:r,origin:Be.REPORT,error:n,status:A}})}))}(e,A);const{handleLog:c}=Or(A);if(Nr(a,e,A,n,o),Mn())!function(t){const e=Tn();t.subscribe(1,(t=>{e.send("log",t)}))}(A);else{const{stop:t}=function(t,e,n,r,A){const i=Bn(t,{endpoint:t.logsEndpointBuilder,encoder:Fn()},t.replica&&{endpoint:t.replica.logsEndpointBuilder,encoder:Fn()},n,r,A.expireObservable);return e.subscribe(1,(t=>{i.add(t)})),i}(e,A,o,s,a);i.push((()=>t()))}var l;return{handleLog:c,getInternalContext:(l=a,{get:t=>{const e=l.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,stop:()=>{i.forEach((t=>t()))}}}));!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&A.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=>a(t,"onReady callback threw an error:")()))}(x(),"DD_LOGS",kr);const Br="GET",Fr="POST",Gr="x-api-key",Ur="x-access-token",Qr="content-type",zr="/v4/partner-login",Vr="/v4/partner-login-signed",qr="/v4/partner-refresh-token",Yr="/v5/users/me",jr="[SkyPath SDK]: Old fetch request aborted",Hr="local",Xr="development",$r="staging",Wr="production",Kr={[Hr]:"https://staging-api.skypath.io",[Xr]:"https://dev-api.skypath.io",[$r]:"https://staging-api.skypath.io",[Wr]:"https://api.skypath.io"};const Zr="0.4.17",Jr="SDKLogger",tA={SDK:`[SkyPathSDK v${Zr}]:`,NETWORK:"[Network]:"},eA="Invalid listener",nA="Missing authentication parameters",rA="Failed to authenticate with authCallback",AA="Failed to authenticate with API key",iA="Failed to get authentication token";class oA extends Error{constructor({error:t,context:e={}}){t||={message:"Unknown error"},super(t.message),this.name=this.constructor.name,this.context=e;const n=kr.getLogger(Jr);n?.error(this.message,{context:e},e?.error||t)}}class sA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class aA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class uA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class cA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}class lA extends oA{constructor(t,e={}){super({error:new Error(t),context:e})}}const fA={INFO:"/v5/gtg/info",DATA:"/v5/gtg/{resolution}/{hexId}"};class hA{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:fA.INFO})).data}catch(t){throw new aA("Failed to get GTG info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=fA.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r};return(await this.#t({path:A,params:i})).data}catch(t){throw new aA("Failed to get GTG data",{error:t})}}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function pA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dA={exports:{}};dA.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",A="second",i="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),A=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(A,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()),A=e.clone().add(r,u),i=n-A<0,o=e.clone().add(r+(i?-1:1),u);return+(-(r+(n-A)/(i?A-o:o-A))||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:i,s:A,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=g;var E="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[E])},b=function t(e,n,r){var A;if(!e)return m;if("string"==typeof e){var i=e.toLowerCase();v[i]&&(A=i),n&&(v[i]=n,A=i);var o=e.split("-");if(!A&&o.length>1)return t(o[0])}else{var s=e.name;v[s]=e,A=s}return!r&&A&&(m=A),A||!r&&m},I=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)},C=_;C.l=b,C.i=w,C.w=function(t,e){return I(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=b(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[E]=!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(C.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 A=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}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 C},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(t,e){var n=I(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return I(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<I(t)},y.$g=function(t,e,n){return C.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=!!C.u(e)||e,c=C.p(t),h=function(t,e){var A=C.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?A:A.endOf(s)},p=function(t,e){return C.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 i:return p(_+"Seconds",2);case A: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=C.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[i]=c+"Minutes",n[A]=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[C.p(t)]()},y.add=function(r,c){var f,h=this;r=Number(r);var p=C.p(c),d=function(t){var e=I(h);return C.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[i]=e,f[o]=n,f[A]=t,f)[p]||1,y=this.$d.getTime()+r*g;return C.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",A=C.z(this),i=this.$H,o=this.$m,s=this.$M,a=n.weekdays,u=n.months,c=n.meridiem,l=function(t,n,A,i){return t&&(t[n]||t(e,r))||A[n].slice(0,i)},f=function(t){return C.s(i%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 C.s(e.$y,4,"0");case"M":return s+1;case"MM":return C.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 C.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(i);case"HH":return C.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(i,o,!0);case"A":return p(i,o,!1);case"m":return String(o);case"mm":return C.s(o,2,"0");case"s":return String(e.$s);case"ss":return C.s(e.$s,2,"0");case"SSS":return C.s(e.$ms,3,"0");case"Z":return A}return null}(t)||A.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,f,h){var p,d=this,g=C.p(f),y=I(r),_=(y.utcOffset()-this.utcOffset())*e,m=this-y,v=function(){return C.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 i:p=m/e;break;case A:p=m/t;break;default:p=m}return h?p:C.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=b(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return C.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}(),N=x.prototype;return I.prototype=N,[["$ms",r],["$s",A],["$m",i],["$H",o],["$W",s],["$M",u],["$y",l],["$D",f]].forEach((function(t){N[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),I.extend=function(t,e){return t.$i||(t(e,x,I),t.$i=!0),I},I.locale=b,I.isDayjs=w,I.unix=function(t){return I(1e3*t)},I.en=v[m],I.Ls=v,I.p={},I}();var gA=pA(dA.exports),yA=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var A,i,o,s,a=!1;A="object"==typeof window,i="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,a=o&&!A&&!i,s=!A&&!a&&!i;var u,c,l,f,h,p="";a?(p=__dirname+"/",u=function(t,e){var n;return(n=rt(t))||(f||(f=require("fs")),h||(h=require("path")),t=h.normalize(t),n=f.readFileSync(t)),e?n:n.toString()},l=function(t){var e=u(t,!0);return e.buffer||(e=new Uint8Array(e)),m(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(u=function(t){var e=rt(t);return e?et(e):read(t)}),l=function(t){var e;return(e=rt(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(m("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(A||i)&&(i?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=rt(t);if(n)return et(n);throw e}},i&&(l=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=rt(t);if(n)return n;throw e}}),c=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 A=rt(t);A?e(A.buffer):n()}},r.onerror=n,r.send(null)});var d=n.print||console.log.bind(console),g=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var y=0;var _=!1;function m(t,e){t||yt("Assertion failed: "+e)}function v(t){var e=n["_"+t];return m(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function E(t,e,n,r,A){var i={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 A=n,i=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>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)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,I,e,n)})(t,e=at(n),n)}return e},array:function(t){var e=at(t.length);return function(t,e){b.set(t,e)}(t,e),e}};var o=v(t),s=[],a=0;if(r)for(var u=0;u<r.length;u++){var c=i[n[u]];c?(0===a&&(a=ct()),s[u]=c(r[u])):s[u]=r[u]}var l=o.apply(null,s);return l=function(t){return"string"===e?L(t):"boolean"===e?Boolean(t):t}(l),0!==a&&ut(a),l}var w,b,I,C,x,N,S,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(t,e){return t?function(t,e,n){for(var r=e+n,A=e;t[A]&&!(A>=r);)++A;if(A-e>16&&t.subarray&&D)return D.decode(t.subarray(e,A));for(var i="";e<A;){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)i+=String.fromCharCode(o);else{var u=o-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i}(I,t,e):""}function T(t,e){return t%e>0&&(t+=e-t%e),t}function M(t){w=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=C=new Int16Array(t),n.HEAP32=x=new Int32Array(t),n.HEAPU8=I=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=N=new Float32Array(t),n.HEAPF64=S=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var O=n.TOTAL_MEMORY||33554432;function R(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()}}O=(w=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,M(w),x[6032]=5267040;var P=[],k=[],B=[],F=[];var G=Math.abs,U=Math.ceil,Q=Math.floor,z=Math.min,V=0,q=null;n.preloadedImages={},n.preloadedAudios={};var Y,j,H=null,X="data:application/octet-stream;base64,";function $(t){return String.prototype.startsWith?t.startsWith(X):0===t.indexOf(X)}H="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//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function W(t){return t}function K(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function Z(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return b.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(b),it(e),M(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r>255&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,r,A,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(u++))<<2|(A=s.indexOf(t.charAt(u++)))>>4,n=(15&A)<<4|(i=s.indexOf(t.charAt(u++)))>>2,r=(3&i)<<6|(o=s.indexOf(t.charAt(u++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==o&&(a+=String.fromCharCode(r))}while(u<t.length);return a};function rt(t){if($(t))return function(t){if("boolean"==typeof a&&a){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),r=new Uint8Array(n.length),A=0;A<n.length;++A)r[A]=n.charCodeAt(A);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(X.length))}var At=function(t,e,n){var r=new t.Int8Array(n),A=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var i=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,E=t.Math.min,w=t.Math.max,b=t.Math.clz32,I=e.b,C=e.c,x=e.d,N=e.e,S=e.f,D=e.g,L=e.h,T=e.i,M=24160;function O(t,e,n,r){return 0|R(t|=0,e|=0,n|=0,r|=0,0)}function R(t,e,n,r,i){var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,a=o,!(0|P(t|=0,e|=0,n|=0,r|=0,i|=0)))return M=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,a)))break;a=0|A[(u=a)>>2],u=0|A[u+4>>2]}else c=0|Be(0|n,0|(s=((0|n)<0)<<31>>31),3,0),u=0|C(),s=0|Me(0|n,0|s,1,0),s=0|Me(0|(s=0|Be(0|c,0|u,0|s,0|C())),0|C(),1,0),u=0|C(),A[a>>2]=s,A[a+4>>2]=u,a=s;if(He(0|r,0,a<<3),0|i){He(0|i,0,a<<2),s=0|k(t,e,n,r,i,a,u,0);break}(s=0|Te(a,4))?(c=0|k(t,e,n,r,s,a,u,0),Le(s),s=c):s=13}else s=2}while(0);return M=o,0|(c=s)}function P(t,e,n,r,i){t|=0,e|=0,n|=0,r|=0,i|=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,A[(d=o=s)>>2]=t,A[d+4>>2]=e,(0|n)<0)return M=s,0|(g=2);if(A[(a=r)>>2]=t,A[a+4>>2]=e,(a=!!(0|i))&&(A[i>>2]=0),0|Bt(t,e))return M=s,0|(g=9);A[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|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,A[i+(h<<2)>>2]=d,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(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|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(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,i,o,s,a){n|=0,r|=0,i|=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|Ge(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),p=0|C(),!(!(0|(_=0|A[(y=d=r+(f<<3)|0)>>2]))&!(0|(y=0|A[y+4>>2]))|(h=(0|_)==(0|t)&(0|y)==(0|e))))do{f=0|Fe(0|(f=0|Me(0|f,0|p,1,0)),0|C(),0|o,0|s),p=0|C(),h=(0|(y=0|A[(_=d=r+(f<<3)|0)>>2]))==(0|t)&(0|(_=0|A[_+4>>2]))==(0|e)}while(!(!(0|y)&!(0|_)|h));if(f=i+(f<<2)|0,h&&(0|A[f>>2])<=(0|a))return M=l,0|(_=0);if(A[(_=d)>>2]=t,A[_+4>>2]=e,A[f>>2]=a,(0|a)>=(0|n))return M=l,0|(_=0);switch(h=a+1|0,A[u>>2]=0,0|(f=0|B(t,e,2,u,c))){case 9:g=9;break;case 0:(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h))||(g=9)}t:do{if(9==(0|g)){switch(A[u>>2]=0,0|(f=0|B(t,e,3,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,1,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,5,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,4,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,6,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,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,i){t|=0,e|=0,i|=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|(i=1);if(f=(0|A[(r|=0)>>2])%6|0,A[r>>2]=f,(0|f)>0){a=0;do{n=0|pt(n),a=a+1|0}while((0|a)<(0|A[r>>2]))}if(f=0|Qe(0|t,0|e,45),C(),(s=127&f)>>>0>121)return 0|(i=5);o=0|Ft(t,e),a=0|Qe(0|t,0|e,52),C(),a&=15;t:do{if(a){for(;;){if(c=0|Qe(0|t,0|e,0|(u=3*(15-a|0)|0)),C(),7==(0|(c&=7))){e=5;break}if(p=!(0|Vt(a)),a=a+-1|0,h=0|ze(7,0,0|u),e&=~C(),t=0|ze(0|A[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|t&~h,e|=u=0|C(),!(n=0|A[(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|ze(0|(p=0|A[848+(28*s|0)+(n<<2)>>2]),0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+(n<<2)>>2],127&~p||(p=0|ze(0|A[848+(28*s|0)+20>>2],0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+20>>2],t=0|Ut(p|t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]))),c=0|Qe(0|t,0|e,45),C(),c&=127;t:do{if(0|U(c)){e:do{if(1==(0|Ft(t,e))){if((0|s)!=(0|c)){if(0|q(c,0|A[7696+(28*s|0)>>2])){t=0|zt(t,e),u=1,e=0|C();break}x(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ut(t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]),u=0;break e;case 5:t=0|zt(t,e),e=0|C(),A[r>>2]=5+(0|A[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|Gt(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|Q(c))){if(!!(0|u)|5!=(0|Ft(t,e)))break;A[r>>2]=1+(0|A[r>>2]);break}switch(127&f){case 8:case 118:break t}3!=(0|Ft(t,e))&&(A[r>>2]=1+(0|A[r>>2]))}}else if((0|n)>0){a=0;do{t=0|Ut(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return A[r>>2]=((0|A[r>>2])+n|0)%6|0,A[(p=i)>>2]=t,A[p+4>>2]=e,0|(p=0)}function F(t,e,n,r){n|=0,r|=0;var i,o,s,a=0,u=0;for(s=M,M=M+16|0,i=s,o=s+8|0,a=(a=!(0|Bt(t|=0,e|=0)))?1:2;;){if(A[o>>2]=0,!(0|B(t,e,a,o,i))&((0|A[(u=i)>>2])==(0|n)?(0|A[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 G(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,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,R=0,P=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|A[(t|=0)>>2]))<=0)return M=_,0|(P=0);for(l=t+4|0,f=d+8|0,h=g+8|0,p=u+8|0,m=0,O=0;;){T=(E=0|A[l>>2])+(O<<4)|0,A[d>>2]=A[T>>2],A[d+4>>2]=A[T+4>>2],A[d+8>>2]=A[T+8>>2],A[d+12>>2]=A[T+12>>2],(0|O)==(v+-1|0)?(A[g>>2]=A[E>>2],A[g+4>>2]=A[E+4>>2],A[g+8>>2]=A[E+8>>2],A[g+12>>2]=A[E+12>>2]):(T=E+(O+1<<4)|0,A[g>>2]=A[T>>2],A[g+4>>2]=A[T+4>>2],A[g+8>>2]=A[T+8>>2],A[g+12>>2]=A[T+12>>2]),v=0|W(d,g,r,y);t:do{if(v)E=0,m=v;else if(v=0|A[(E=y)>>2],(0|(E=0|A[E+4>>2]))>0|!(0|E)&v>>>0>0){L=0,T=0;e:for(;;){if(G=+i[d>>3],F=+((D=0|Oe(0|v,0|E,0|L,0|T))>>>0)+4294967296*+(0|C()),k=+(v>>>0)+4294967296*+(0|E),B=+(L>>>0)+4294967296*+(0|T),i[u>>3]=G*F/k+ +i[g>>3]*B/k,i[p>>3]=+i[f>>3]*F/k+ +i[h>>3]*B/k,0|(v=0|qt(u,r,c))){m=v;break}I=0|Ge(0|(S=0|A[(D=c)>>2]),0|(D=0|A[D+4>>2]),0|e,0|n),w=0|C(),E=0|A[(b=v=a+(I<<3)|0)>>2],b=0|A[b+4>>2];n:do{if(!(0|E)&!(0|b))R=v,P=16;else for(x=0,N=0;;){if((0|x)>(0|n)|(0|x)==(0|n)&N>>>0>e>>>0){m=1;break e}if((0|E)==(0|S)&(0|b)==(0|D))break n;if(I=0|Fe(0|(v=0|Me(0|I,0|w,1,0)),0|C(),0|e,0|n),w=0|C(),N=0|Me(0|N,0|x,1,0),x=0|C(),!(0|(E=0|A[(b=v=a+(I<<3)|0)>>2]))&!(0|(b=0|A[b+4>>2]))){R=v,P=16;break}}}while(0);if(16!=(0|P)||(P=0,!(0|S)&!(0|D))||(A[(N=R)>>2]=S,A[N+4>>2]=D,N=s+(A[o>>2]<<3)|0,A[N>>2]=S,A[N+4>>2]=D,N=0|Me(0|A[(N=o)>>2],0|A[N+4>>2],1,0),S=0|C(),A[(D=o)>>2]=N,A[D+4>>2]=S),L=0|Me(0|L,0|T,1,0),T=0|C(),v=0|A[(E=y)>>2],!((0|(E=0|A[E+4>>2]))>(0|T)|(0|E)==(0|T)&v>>>0>L>>>0)){E=1;break t}}E=0}else E=1}while(0);if(O=O+1|0,!E){P=21;break}if((0|O)>=(0|(v=0|A[t>>2]))){m=0,P=21;break}}return 21==(0|P)?(M=_,0|m):0}function U(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|A[7696+(28*t|0)+16>>2])}function Q(t){return 4==(0|(t|=0))|117==(0|t)}function z(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)>>2]}function V(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)+4>>2]}function q(t,e){return e|=0,(0|A[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|A[7696+(28*t|0)+24>>2])==(0|e))}function Y(t,e){return 0|A[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function j(t,e){return e|=0,(0|A[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|A[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|A[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|A[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|A[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|A[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|A[848+(28*t|0)+24>>2])==(0|e)?6:7)}function H(t){return+i[(t|=0)+16>>3]<+i[t+24>>3]|0}function X(t,e){t|=0;var n,r,A=0;return(A=+i[(e|=0)>>3])>=+i[t+8>>3]&&A<=+i[t>>3]?(n=+i[t+16>>3],A=+i[t+24>>3],e=(r=+i[e+8>>3])>=A,t=r<=n&1,n<A?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function $(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,b=0;h=M,M=M+288|0,f=h+264|0,_=h+96|0,g=(d=y=h)+96|0;do{A[d>>2]=0,d=d+4|0}while((0|d)<(0|g));return 0|(e=0|$t(e,y))?(M=h,0|(w=e)):(Ht(y=0|A[(g=y)>>2],g=0|A[g+4>>2],f),Xt(y,g,_),l=+te(f,_+8|0),i[f>>3]=+i[t>>3],i[(g=f+8|0)>>3]=+i[t+16>>3],i[_>>3]=+i[t+8>>3],i[(y=_+8|0)>>3]=+i[t+24>>3],s=+te(f,_),b=+i[g>>3]-+i[y>>3],c=+u(+b),p=+i[f>>3]-+i[_>>3],r=+u(+p),!(0==b|0==p)&&(b=+Ve(+c,+r),b=+m(+s*s/+qe(+b/+qe(+c,+r),3)/(l*(2.59807621135*l)*.8)),i[o>>3]=b,v=~~b>>>0,w=+u(b)>=1?b>0?~~+E(+a(b/4294967296),4294967295)>>>0:~~+m((b-+(~~b>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2])?(_=!(0|v)&!(0|w),A[(e=n)>>2]=_?1:v,A[e+4>>2]=_?0:w,e=0):e=1,M=h,0|(w=e))}function W(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{A[h>>2]=0,h=h+4|0}while((0|h)<(0|s));return 0|(n=0|$t(n,p))?(M=f,0|(r=n)):(Ht(h=0|A[(n=p)>>2],n=0|A[n+4>>2],c),Xt(h,n,l),d=+te(c,l+8|0),d=+m(+ +te(t,e)/(2*d)),i[o>>3]=d,n=~~d>>>0,h=+u(d)>=1?d>0?~~+E(+a(d/4294967296),4294967295)>>>0:~~+m((d-+(~~d>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2]?(p=!(0|n)&!(0|h),A[r>>2]=p?1:n,A[r+4>>2]=p?0:h,M=f,0|(r=0)):(M=f,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,A[(t|=0)>>2]=e,A[t+4>>2]=n,A[t+8>>2]=r}function Z(t,e){t|=0;var n,r,o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0;A[(s=(e|=0)+8|0)>>2]=0,r=+i[t>>3],f=+u(+r),o=+i[t+8>>3],f+=.5*(h=+u(+o)/.8660254037844386),f-=+(0|(a=~~f)),h-=+(0|(t=~~h));do{if(f<.5){if(f<.3333333333333333){if(A[e>>2]=a,h<.5*(f+1)){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(t=(1&!(h<(d=1-f)))+t|0,A[e+4>>2]=t,d<=h&h<2*f){a=a+1|0,A[e>>2]=a;break}A[e>>2]=a;break}if(!(f<.6666666666666666)){if(a=a+1|0,A[e>>2]=a,h<.5*f){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(h<1-f){if(A[e+4>>2]=t,2*f-1<h){A[e>>2]=a;break}}else t=t+1|0,A[e+4>>2]=t;a=a+1|0,A[e>>2]=a}while(0);do{if(r<0){if(1&t){a=~~(+(0|a)-(2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))+1)),A[e>>2]=a;break}a=~~(+(0|a)-2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))),A[e>>2]=a;break}}while(0);p=e+4|0,o<0&&(a=a-((1|t<<1)/2|0)|0,A[e>>2]=a,t=0-t|0,A[p>>2]=t),c=t-a|0,(0|a)<0?(l=0-a|0,A[p>>2]=c,A[s>>2]=l,A[e>>2]=0,t=c,a=0):l=0,(0|t)<0&&(a=a-t|0,A[e>>2]=a,l=l-t|0,A[s>>2]=l,A[p>>2]=0,t=0),n=a-l|0,c=t-l|0,(0|l)<0&&(A[e>>2]=n,A[p>>2]=c,A[s>>2]=0,t=c,a=n,l=0),(0|(c=(0|l)<(0|(c=(0|t)<(0|a)?t:a))?l:c))<=0||(A[e>>2]=a-c,A[p>>2]=t-c,A[s>>2]=l-c)}function J(t){var e,n=0,r=0,i=0,o=0,s=0;n=0|A[(t|=0)>>2],r=0|A[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,A[e>>2]=r,A[(s=t+8|0)>>2]=(0|A[s>>2])-n,A[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,A[t>>2]=n,o=(0|A[(s=t+8|0)>>2])-r|0,A[s>>2]=o,A[e>>2]=0,r=0):(s=o=t+8|0,o=0|A[o>>2]),(0|o)<0&&(n=n-o|0,A[t>>2]=n,r=r-o|0,A[e>>2]=r,A[s>>2]=0,o=0),(0|(i=(0|o)<(0|(i=(0|r)<(0|n)?r:n))?o:i))<=0||(A[t>>2]=n-i,A[e>>2]=r-i,A[s>>2]=o-i)}function tt(t,e){e|=0;var n,r;r=0|A[(t|=0)+8>>2],n=+((0|A[t+4>>2])-r|0),i[e>>3]=+((0|A[t>>2])-r|0)-.5*n,i[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[e>>2])+(0|A[t>>2]),A[n+4>>2]=(0|A[e+4>>2])+(0|A[t+4>>2]),A[n+8>>2]=(0|A[e+8>>2])+(0|A[t+8>>2])}function nt(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[t>>2])-(0|A[e>>2]),A[n+4>>2]=(0|A[t+4>>2])-(0|A[e+4>>2]),A[n+8>>2]=(0|A[t+8>>2])-(0|A[e+8>>2])}function rt(t,e){e|=0;var n,r=0;r=0|v(0|A[(t|=0)>>2],e),A[t>>2]=r,n=0|v(0|A[(r=t+4|0)>>2],e),A[r>>2]=n,e=0|v(0|A[(t=t+8|0)>>2],e),A[t>>2]=e}function At(t){var e,n,r=0,i=0,o=0,s=0,a=0;a=(0|(n=0|A[(t|=0)>>2]))<0,t=(t=(i=(0|(s=((e=(0|(o=(0|A[t+4>>2])-(a?n:0)|0))<0)?0-o|0:0)+((0|A[t+8>>2])-(a?n:0))|0))<0)?0:s)-((o=(0|(i=(0|t)<(0|(i=(0|(r=(e?0:o)-(i?s:0)|0))<(0|(s=(a?0:n)-(e?o:0)-(i?s:0)|0))?r:s))?t:i))>0)?i:0)|0,r=r-(o?i:0)|0;t:do{switch(s-(o?i: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 it(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(a=1)}else{if((-2147483648-s|0)>(0|s))return 0|(a=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(a=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1)}else if((-2147483648-o|0)>(0|o))return 0|(a=1);if(i=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(a=1)}else if((-2147483648^n)<(0|o))return 0|(a=1);if(r){if(!((2147483647-s|0)<(0|i))){r=i;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|i))){r=i;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);i=0|Se(+(n-o|0)/7),A[t>>2]=i,o=0|Se(+(r+s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,355,22455)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function ot(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1)}else if((-2147483648-s|0)>(0|s))return 0|(a=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(a=1)}else{if((-2147483648-o|0)>(0|o))return 0|(a=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(a=1)}if(i=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(a=1)}else if((-2147483648-n|0)>(0|o))return 0|(a=1);if((0|o)>-1){if((-2147483648|i)<(0|s)){r=i;break}return 0|(n=1)}if(!((-2147483648^i)<(0|s))){r=i;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);i=0|Se(+(n+o|0)/7),A[t>>2]=i,o=0|Se(+(r-s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,404,22469)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function st(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+((3*(r=(0|A[t>>2])-i|0)|0)-(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((i<<1)+r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function at(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+(((r=(0|A[t>>2])-i|0)<<1)+(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((3*i|0)-r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function ut(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(3*i|0)|0,A[t>>2]=a,o=s+(3*o|0)|0,A[n>>2]=o,i=(3*s|0)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ct(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(3*(i=0|A[(n=t+4|0)>>2])|0)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(3*a|0)|0,A[t>>2]=a,A[n>>2]=s,i=(3*o|0)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function lt(t,e){t|=0;var n,r,i,o=0,s=0,a=0;((e|=0)+-1|0)>>>0>=6||(a=(0|A[15440+(12*e|0)>>2])+(0|A[t>>2])|0,A[t>>2]=a,i=t+4|0,s=(0|A[15440+(12*e|0)+4>>2])+(0|A[i>>2])|0,A[i>>2]=s,r=t+8|0,e=(0|A[15440+(12*e|0)+8>>2])+(0|A[r>>2])|0,A[r>>2]=e,o=s-a|0,(0|a)<0?(e=e-a|0,A[i>>2]=o,A[r>>2]=e,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,e=e-o|0,A[r>>2]=e,A[i>>2]=0,o=0),n=s-e|0,a=o-e|0,(0|e)<0?(A[t>>2]=n,A[i>>2]=a,A[r>>2]=0,s=n,e=0):a=o,(0|(o=(0|e)<(0|(o=(0|a)<(0|s)?a:s))?e:o))<=0||(A[t>>2]=s-o,A[i>>2]=a-o,A[r>>2]=e-o))}function ft(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(i=0|A[(n=t+4|0)>>2])+a|0,a=(o=0|A[(r=t+8|0)>>2])+a|0,A[t>>2]=a,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ht(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],s=0|A[(n=t+4|0)>>2],o=0|A[(r=t+8|0)>>2],a=s+i|0,A[t>>2]=a,s=o+s|0,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function pt(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 dt(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 gt(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(i<<1)|0,A[t>>2]=a,o=s+(o<<1)|0,A[n>>2]=o,i=(s<<1)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function yt(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=((i=0|A[(n=t+4|0)>>2])<<1)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(a<<1)|0,A[t>>2]=a,A[n>>2]=s,i=(o<<1)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function _t(t,e){e|=0;var n,r,i,o=0,s=0,a=0;return i=(0|(r=(0|A[(t|=0)>>2])-(0|A[e>>2])|0))<0,n=(0|(s=(0|A[t+4>>2])-(0|A[e+4>>2])-(i?r:0)|0))<0,e=(e=(t=(0|(a=(i?0-r|0:0)+(0|A[t+8>>2])-(0|A[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=(i?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 mt(t,e){e|=0;var n;n=0|A[(t|=0)+8>>2],A[e>>2]=(0|A[t>>2])-n,A[e+4>>2]=(0|A[t+4>>2])-n}function vt(t,e){e|=0;var n,r,i,o=0,s=0,a=0;s=0|A[(t|=0)>>2],A[e>>2]=s,a=0|A[t+4>>2],A[(r=e+4|0)>>2]=a,A[(i=e+8|0)>>2]=0,t=(o=(0|a)<(0|s))?s:a,o=o?a:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=a-s|0,(0|s)<0?(o=0-s|0,A[r>>2]=t,A[i>>2]=o,A[e>>2]=0,s=0):(t=a,o=0),(0|t)<0&&(s=s-t|0,A[e>>2]=s,o=o-t|0,A[i>>2]=o,A[r>>2]=0,t=0),n=s-o|0,a=t-o|0,(0|o)<0?(A[e>>2]=n,A[r>>2]=a,A[i>>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||(A[e>>2]=a-s,A[r>>2]=t-s,A[i>>2]=o-s),0|(e=0)}function Et(t){var e,n,r,i;n=(i=0|A[(e=(t|=0)+8|0)>>2])-(0|A[t>>2])|0,A[t>>2]=n,t=(0|A[(r=t+4|0)>>2])-i|0,A[r>>2]=t,A[e>>2]=0-(t+n)}function wt(t){var e,n,r=0,i=0,o=0,s=0,a=0;r=0-(i=0|A[(t|=0)>>2])|0,A[t>>2]=r,A[(e=t+8|0)>>2]=0,s=(o=0|A[(n=t+4|0)>>2])+i|0,(0|i)>0?(A[n>>2]=s,A[e>>2]=i,A[t>>2]=0,r=0,o=s):i=0,(0|o)<0?(a=r-o|0,A[t>>2]=a,i=i-o|0,A[e>>2]=i,A[n>>2]=0,s=a-i|0,r=0-i|0,(0|i)<0?(A[t>>2]=s,A[n>>2]=r,A[e>>2]=0,o=r,i=0):(o=0,s=a)):s=r,(0|(r=(0|i)<(0|(r=(0|o)<(0|s)?o:s))?i:r))<=0||(A[t>>2]=s-r,A[n>>2]=o-r,A[e>>2]=i-r)}function bt(t,e,n){n|=0;var r,i,o=0,s=0;return i=M,M=M+16|0,r=i,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|Qe(0|(t|=0),0|e,56),C(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,i=0,o=0;if(o=M,M=M+16|0,i=o,r=0|Bt(t,e),(n+-1|0)>>>0>5)return M=o,0|(i=-1);if(r=!!(0|r),1==(0|n)&r)return M=o,0|(i=-1);do{if(!(0|me(t,e,i))){if(r){r=(5+(0|A[21936+(n<<2)>>2])-(0|A[i>>2])|0)%5|0;break}r=(6+(0|A[21968+(n<<2)>>2])-(0|A[i>>2])|0)%6|0;break}r=-1}while(0);return i=r,M=o,0|i}(t,s,7&o),-1==(0|o)?(A[n>>2]=0,M=i,0|(s=6)):(0|jt(t,s,r)&&x(23313,22484,282,22499),e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,s)?Nt(r,e,o,2,n):Tt(r,e,o,2,n),M=i,0|(s=0))):(M=i,0|(s=6))}function It(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,A=0;n=+i[t>>3],r=+f(+n),n=+h(+n),i[e+16>>3]=n,n=+i[t+8>>3],A=r*+f(+n),i[e>>3]=A,n=r*+h(+n),i[e+8>>3]=n}(t,o),A[e>>2]=0,i[n>>3]=5,r=+_e(16400,o),r<+i[n>>3]&&(A[e>>2]=0,i[n>>3]=r);r=+_e(16424,o),r<+i[n>>3]&&(A[e>>2]=1,i[n>>3]=r);r=+_e(16448,o),r<+i[n>>3]&&(A[e>>2]=2,i[n>>3]=r);r=+_e(16472,o),r<+i[n>>3]&&(A[e>>2]=3,i[n>>3]=r);r=+_e(16496,o),r<+i[n>>3]&&(A[e>>2]=4,i[n>>3]=r);r=+_e(16520,o),r<+i[n>>3]&&(A[e>>2]=5,i[n>>3]=r);r=+_e(16544,o),r<+i[n>>3]&&(A[e>>2]=6,i[n>>3]=r);r=+_e(16568,o),r<+i[n>>3]&&(A[e>>2]=7,i[n>>3]=r);r=+_e(16592,o),r<+i[n>>3]&&(A[e>>2]=8,i[n>>3]=r);r=+_e(16616,o),r<+i[n>>3]&&(A[e>>2]=9,i[n>>3]=r);r=+_e(16640,o),r<+i[n>>3]&&(A[e>>2]=10,i[n>>3]=r);r=+_e(16664,o),r<+i[n>>3]&&(A[e>>2]=11,i[n>>3]=r);r=+_e(16688,o),r<+i[n>>3]&&(A[e>>2]=12,i[n>>3]=r);r=+_e(16712,o),r<+i[n>>3]&&(A[e>>2]=13,i[n>>3]=r);r=+_e(16736,o),r<+i[n>>3]&&(A[e>>2]=14,i[n>>3]=r);r=+_e(16760,o),r<+i[n>>3]&&(A[e>>2]=15,i[n>>3]=r);r=+_e(16784,o),r<+i[n>>3]&&(A[e>>2]=16,i[n>>3]=r);r=+_e(16808,o),r<+i[n>>3]&&(A[e>>2]=17,i[n>>3]=r);r=+_e(16832,o),r<+i[n>>3]&&(A[e>>2]=18,i[n>>3]=r);if(r=+_e(16856,o),!(r<+i[n>>3]))return void(M=s);A[e>>2]=19,i[n>>3]=r,M=s}(t|=0,n|=0,c=o),(a=+d(+(1-.5*+i[c>>3])))<1e-16)return A[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=0,A[r+12>>2]=0,void(M=o);if(c=0|A[n>>2],s=+Zt((s=+i[15920+(24*c|0)>>3])-+Zt(+function(t,e){t|=0,e|=0;var n=0,r=0,A=0,o=0,s=0;return o=+i[e>>3],r=+f(+o),A=+i[e+8>>3]-+i[t+8>>3],s=r*+h(+A),n=+i[t>>3],+ +_(+s,+(+h(+o)*+f(+n)-+f(+A)*(r*+h(+n))))}(15600+(c<<4)|0,t))),u=0|Vt(e)?+Zt(s+-.3334731722518321):s,s=+p(+a)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}a=+f(+u)*s,i[r>>3]=a,u=+h(+u)*s,i[r+8>>3]=u,M=o}function Ct(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,a=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+i[t>>3],e=+i[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,A[o>>2]=A[e>>2],A[o+4>>2]=A[e+4>>2],A[o+8>>2]=A[e+8>>2],void(A[o+12>>2]=A[e+12>>2]);if(a=+_(+ +i[t+8>>3],+ +i[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=!(0|Vt(n)),s=+y(.381966011250105*(n?s:s/2.6457513110645907))):(s=+y(.381966011250105*s),0|Vt(n)&&(a=+Zt(a+.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 A[r>>2]=A[t>>2],A[r+4>>2]=A[t+4>>2],A[r+8>>2]=A[t+8>>2],void(A[r+12>>2]=A[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=+i[t>>3],o){e-=n,i[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)),i[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return i[r>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[r>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(c=+f(+e),s=n*+h(+s)/c,n=+i[t>>3],e=(a-+h(+e)*+h(+n))/+f(+n)/c,a=s>1?1:s,e=e>1?1:e,(e=+i[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(i[r+8>>3]=e)}e=+i[t>>3]+n,i[r>>3]=e,o=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return i[o>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[o>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(e=+i[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);i[r+8>>3]=e}(15600+(e<<4)|0,+Zt(+i[15920+(24*e|0)>>3]-a),s,o)}function xt(t,e,n){e|=0,n|=0;var r,i;r=M,M=M+16|0,tt((t|=0)+4|0,i=r),Ct(i,0|A[t>>2],e,0,n),M=r}function Nt(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,E,w,b,I,C,N,S,D,L=0,T=0,O=0,R=0,P=0,k=0;if(D=M,M=M+272|0,R=D+240|0,C=D,N=D+224|0,S=D+208|0,y=D+176|0,_=D+160|0,m=D+192|0,v=D+144|0,E=D+128|0,w=D+112|0,b=D+96|0,I=D+80|0,A[(L=D+256|0)>>2]=e,A[R>>2]=A[t>>2],A[R+4>>2]=A[t+4>>2],A[R+8>>2]=A[t+8>>2],A[R+12>>2]=A[t+12>>2],St(R,L,C),A[o>>2]=0,(0|(R=r+n+(5==(0|r)&1)|0))<=(0|n))M=D;else{a=N+4|0,u=y+4|0,c=n+5|0,l=16880+((s=0|A[L>>2])<<2)|0,f=16960+(s<<2)|0,h=E+8|0,p=w+8|0,d=b+8|0,g=S+4|0,O=n;t:for(;;){T=C+((0|O)%5<<4)|0,A[S>>2]=A[T>>2],A[S+4>>2]=A[T+4>>2],A[S+8>>2]=A[T+8>>2],A[S+12>>2]=A[T+12>>2];do{}while(2==(0|Dt(S,s,0,1)));if((0|O)>(0|n)&!!(0|Vt(e))){if(A[y>>2]=A[S>>2],A[y+4>>2]=A[S+4>>2],A[y+8>>2]=A[S+8>>2],A[y+12>>2]=A[S+12>>2],tt(a,_),r=0|A[y>>2],L=0|A[17040+(80*r|0)+(A[N>>2]<<2)>>2],A[y>>2]=A[18640+(80*r|0)+(20*L|0)>>2],(0|(T=0|A[18640+(80*r|0)+(20*L|0)+16>>2]))>0){t=0;do{ft(u),t=t+1|0}while((0|t)<(0|T))}switch(T=18640+(80*r|0)+(20*L|0)+4|0,A[m>>2]=A[T>>2],A[m+4>>2]=A[T+4>>2],A[m+8>>2]=A[T+8>>2],rt(m,3*(0|A[l>>2])|0),et(u,m,u),J(u),tt(u,v),P=+(0|A[f>>2]),i[E>>3]=3*P,i[h>>3]=0,k=-1.5*P,i[w>>3]=k,i[p>>3]=2.598076211353316*P,i[b>>3]=k,i[d>>3]=-2.598076211353316*P,0|A[17040+(80*(0|A[y>>2])|0)+(A[S>>2]<<2)>>2]){case 1:t=w,r=E;break;case 3:t=b,r=w;break;case 2:t=E,r=b;break;default:t=12;break t}ge(_,v,r,t,I),Ct(I,0|A[y>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])}if((0|O)<(0|c)&&(tt(g,y),Ct(y,0|A[S>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),A[N>>2]=A[S>>2],A[N+4>>2]=A[S+4>>2],A[N+8>>2]=A[S+8>>2],A[N+12>>2]=A[S+12>>2],(0|(O=O+1|0))>=(0|R)){t=3;break}}3!=(0|t)?12==(0|t)&&x(22522,22569,571,22579):M=D}}function St(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+128|0,o=r,a=20240,u=(s=i=r+64|0)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20304,u=(s=o)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|Vt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|Vt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,n=n+68|0),J(n),M=r}function Dt(t,e,n,r){n|=0,r|=0;var i,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|A[16960+((e|=0)<<2)>>2],p=(a=!!(0|r))?3*p|0:p,l=0|A[d>>2],i=0|A[(s=t+8|0)>>2],a){if((0|(l=i+l+(r=0|A[(f=t+12|0)>>2])|0))==(0|p))return M=c,0|(d=1);h=f}else l=i+l+(r=0|A[(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|A[t>>2],(0|i)>0){f=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(u,p,0,0),nt(d,u,o),ht(o),et(o,u,d),f=r,r=t):(f=r,r=t)}else f=18640+(80*(0|A[t>>2])|0)+20|0,r=t}while(0);if(A[r>>2]=A[f>>2],(0|A[(l=f+16|0)>>2])>0){r=0;do{ft(d),r=r+1|0}while((0|r)<(0|A[l>>2]))}return t=f+4|0,A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],e=0|A[16880+(e<<2)>>2],rt(u,a?3*e|0:e),et(d,u,d),J(d),r=a&&((0|A[s>>2])+(0|A[d>>2])+(0|A[h>>2])|0)==(0|p)?1:2,M=c,0|(d=r)}function Lt(t,e){t|=0,e|=0;var n=0;do{n=0|Dt(t,e,0,1)}while(2==(0|n));return 0|n}function Tt(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,E,w,b,I,C=0,N=0,S=0,D=0,L=0;if(I=M,M=M+240|0,v=I+208|0,E=I,w=I+192|0,b=I+176|0,d=I+160|0,g=I+144|0,y=I+128|0,_=I+112|0,m=I+96|0,A[(C=I+224|0)>>2]=e,A[v>>2]=A[t>>2],A[v+4>>2]=A[t+4>>2],A[v+8>>2]=A[t+8>>2],A[v+12>>2]=A[t+12>>2],Mt(v,C,E),A[o>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))M=I;else{a=n+6|0,u=16960+((s=0|A[C>>2])<<2)|0,c=g+8|0,l=y+8|0,f=_+8|0,h=w+4|0,N=0,S=n,r=-1;t:for(;;){if(t=E+((C=(0|S)%6|0)<<4)|0,A[w>>2]=A[t>>2],A[w+4>>2]=A[t+4>>2],A[w+8>>2]=A[t+8>>2],A[w+12>>2]=A[t+12>>2],t=N,N=0|Dt(w,s,0,1),(0|S)>(0|n)&!!(0|Vt(e))&&(1!=(0|t)&&(0|A[w>>2])!=(0|r))){switch(tt(E+((C+5|0)%6<<4)+4|0,b),tt(E+(C<<4)+4|0,d),D=+(0|A[u>>2]),i[g>>3]=3*D,i[c>>3]=0,L=-1.5*D,i[y>>3]=L,i[l>>3]=2.598076211353316*D,i[_>>3]=L,i[f>>3]=-2.598076211353316*D,C=0|A[v>>2],0|A[17040+(80*C|0)+(((0|r)==(0|C)?A[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}ge(b,d,r,t,m),0|ye(b,m)||0|ye(d,m)||(Ct(m,0|A[v>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2]))}if((0|S)<(0|a)&&(tt(h,b),Ct(b,0|A[w>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),(0|(S=S+1|0))>=(0|p)){t=3;break}r=0|A[w>>2]}3!=(0|t)?8==(0|t)&&x(22606,22569,736,22651):M=I}}function Mt(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+160|0,o=r,a=20368,u=(s=i=r+80|0)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20448,u=(s=o)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|Vt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|Vt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,e=n+68|0),J(e),A[n+80>>2]=A[t>>2],et(o,i+60|0,n=n+84|0),J(n),M=r}function Ot(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),45),C(),127&e}function Rt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|Qe(0|(t|=0),0|e,45),C(),(o&=127)>>>0>121)return 0|(e=0);n=0|Qe(0|t,0|e,52),C(),n&=15;do{if(0|n){for(A=1,r=0;;){if(i=0|Qe(0|t,0|e,3*(15-A|0)|0),C(),!!(0|(i&=7))&(1^r)){if(1==(0|i)&!!(0|U(o))){s=0,r=13;break}r=1}if(7==(0|i)){s=0,r=13;break}if(!(A>>>0<n>>>0)){r=9;break}A=A+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|Qe(0|t,0|e,3*(14-n|0)|0),C(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Pt(t,e,n,r){n|=0,r|=0;var i=0,o=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return A[r>>2]=t,A[r+4>>2]=e,0|(r=0);if(i=0|ze(0|n,0,52),i|=t,t=C()|-15728641&e,(0|o)>(0|n))do{e=0|ze(7,0,3*(14-n|0)|0),n=n+1|0,i|=e,t=C()|t}while((0|n)<(0|o));return A[r>>2]=i,A[r+4>>2]=t,0|(r=0)}function kt(t,e,n,r){n|=0,r|=0;var i=0,o=0,s=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);i=n-o|0,n=0|Qe(0|t,0|e,45),C();t:do{if(0|U(127&n)){e:do{if(0|o){for(n=1;!((s=0|ze(7,0,3*(15-n|0)|0))&t)&!(C()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C();break t}}while(0);n=0|Me(0|(n=0|Be(0|(n=0|le(7,0,i,((0|i)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),n=0|Me(0|(n=0|ke(0|n,0|C(),6,0)),0|C(),1,0),i=0|C()}else n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C()}while(0);return A[(s=r)>>2]=n,A[s+4>>2]=i,0|(s=0)}function Bt(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&A)))return 0|(A=0);A=0|Qe(0|t,0|e,52),C(),A&=15;t:do{if(A)for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7))break t;if(!(r>>>0<A>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(A=1&!(0|n))}function Ft(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(A&=15))return 0|(A=0);for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7)){r=5;break}if(!(r>>>0<A>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Gt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|ze(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|ze(0|pt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),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|Qe(0|t,0|e,0|(o=3*(15-n|0)|0)),C(),i=0|ze(7,0,0|o),e&=~C(),t=t&~i|(o=0|ze(0|pt(7&A),0,0|o)),e|=C(),!(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 I(0|e),0|t}function Ut(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;o=0|Qe(0|t,0|e,0|(i=3*(15-n|0)|0)),C(),A=0|ze(7,0,0|i),e&=~C(),t=(i=0|ze(0|pt(7&o),0,0|i))|t&~A,e=C()|e,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Qt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|ze(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|ze(0|dt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),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|ze(7,0,0|(A=3*(15-n|0)|0)),o=e&~C(),e=0|Qe(0|t,0|e,0|A),C(),t=t&~i|(e=0|ze(0|dt(7&e),0,0|A)),e=o|C(),!(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 I(0|e),0|t}function zt(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;i=0|ze(7,0,0|(o=3*(15-n|0)|0)),A=e&~C(),e=0|Qe(0|t,0|e,0|o),C(),t=(e=0|ze(0|dt(7&e),0,0|o))|t&~i,e=C()|A,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Vt(t){return(0|(t|=0))%2|0}function qt(t,e,n){n|=0;var r,i=0;return r=M,M=M+16|0,i=r,(e|=0)>>>0>15?(M=r,0|(i=4)):2146435072&~A[(t|=0)+4>>2]&&2146435072&~A[t+8+4>>2]?(function(t,e,n){var r,A;r=M,M=M+16|0,It(t|=0,e|=0,n|=0,A=r),Z(A,n+4|0),M=r}(t,e,i),e=0|function(t,e){t|=0;var n,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0;if(n=M,M=M+64|0,u=n+40|0,i=n+24|0,o=n+12|0,s=n,ze(0|(e|=0),0,52),r=134225919|C(),!e)return(0|A[t+4>>2])>2||(0|A[t+8>>2])>2||(0|A[t+12>>2])>2?(u=0,I(0|(a=0)),M=n,0|u):(ze(0|z(t),0,45),a=C()|r,u=-1,I(0|a),M=n,0|u);if(A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],A[u+12>>2]=A[t+12>>2],a=u+4|0,(0|e)>0)for(t=-1;A[i>>2]=A[a>>2],A[i+4>>2]=A[a+4>>2],A[i+8>>2]=A[a+8>>2],1&e?(st(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ut(o)):(at(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ct(o)),nt(i,o,s),J(s),c=0|ze(7,0,0|(l=3*(15-e|0)|0)),r&=~C(),t=(l=0|ze(0|At(s),0,0|l))|t&~c,r=C()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|A[a>>2])<=2&&(0|A[u+8>>2])<=2&&(0|A[u+12>>2])<=2){if(e=0|ze(0|(i=0|z(u)),0,45),e|=t,t=C()|-1040385&r,s=0|V(u),!(0|U(i))){if((0|s)<=0)break;for(o=0;;){if(i=0|Qe(0|e,0|t,52),C(),i&=15)for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|ze(7,0,0|l),t&=~C(),e=e&~c|(l=0|ze(0|pt(7&u),0,0|l)),t|=C(),r>>>0<i>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|Qe(0|e,0|t,52),C(),o&=15;e:do{if(o){r=1;n:for(;;){switch(l=0|Qe(0|e,0|t,3*(15-r|0)|0),C(),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|q(i,0|A[u>>2]))for(r=1;c=0|ze(7,0,0|(u=3*(15-r|0)|0)),l=t&~C(),t=0|Qe(0|e,0|t,0|u),C(),e=e&~c|(t=0|ze(0|dt(7&t),0,0|u)),t=l|C(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|ze(7,0,0|l),t&=~C(),e=e&~c|(l=0|ze(0|pt(7&u),0,0|l)),t|=C(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|Gt(e,t),t=0|C(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return l=e,I(0|(c=t)),M=n,0|l}(i,e),i=0|C(),A[n>>2]=e,A[n+4>>2]=i,!(0|e)&!(0|i)&&x(23313,22674,786,22697),M=r,0|(i=0)):(M=r,0|(i=3))}function Yt(t,e,n){var r,i=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|Qe(0|(t|=0),0|(e|=0),52),C(),o&=15,s=0|Qe(0|t,0|e,45),C(),i=!(0|o),0|U(127&s)){if(i)return 0|(s=1);i=1}else{if(i)return 0|(s=0);i=0|A[r>>2]||0|A[n+8>>2]?1:1&!!(0|A[n+12>>2])}for(n=1;1&n?ut(r):ct(r),s=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),lt(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|i}function jt(t,e,n){n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+16|0,r=i,l=0|Qe(0|(t|=0),0|(e|=0),45),C(),(l&=127)>>>0>121)return A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,A[n+12>>2]=0,M=i,0|(l=5);t:do{if(0|U(l)&&(a=0|Qe(0|t,0|e,52),C(),0|(a&=15))){o=1;e:for(;;){switch(c=0|Qe(0|t,0|e,3*(15-o|0)|0),C(),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|ze(7,0,0|(e=3*(15-s|0)|0)),c=o&~C(),o=0|Qe(0|t,0|o,0|e),C(),t=t&~u|(o=0|ze(0|dt(7&o),0,0|e)),o=c|C(),s>>>0<a>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*l|0)|0,A[n>>2]=A[c>>2],A[n+4>>2]=A[c+4>>2],A[n+8>>2]=A[c+8>>2],A[n+12>>2]=A[c+12>>2],!(0|Yt(t,o,n)))return M=i,0|(l=0);if(u=n+4|0,A[r>>2]=A[u>>2],A[r+4>>2]=A[u+4>>2],A[r+8>>2]=A[u+8>>2],a=0|Qe(0|t,0|o,52),C(),c=15&a,1&a?(ct(u),a=c+1|0):a=c,0|U(l)){t:do{if(c)for(e=1;;){if(s=0|Qe(0|t,0|o,3*(15-e|0)|0),C(),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|Dt(n,a,o,0)){if(0|U(l))do{}while(0|Dt(n,a,0,0));(0|a)!=(0|c)&&at(u)}else(0|a)!=(0|c)&&(A[u>>2]=A[r>>2],A[u+4>>2]=A[r+4>>2],A[u+8>>2]=A[r+8>>2]);return M=i,0|(l=0)}function Ht(t,e,n){n|=0;var r,A,i=0;return A=M,M=M+16|0,0|(i=0|jt(t|=0,e|=0,r=A))?(M=A,0|i):(i=0|Qe(0|t,0|e,52),C(),xt(r,15&i,n),M=A,0|(i=0))}function Xt(t,e,n){n|=0;var r,A=0,i=0,o=0;if(r=M,M=M+16|0,0|(A=0|jt(t|=0,e|=0,o=r)))return M=r,0|(o=A);A=0|Qe(0|t,0|e,45),C(),A=!(0|U(127&A)),i=0|Qe(0|t,0|e,52),C(),i&=15;t:do{if(!A){if(0|i)for(A=1;;){if(!(!((0|ze(7,0,3*(15-A|0)|0))&t)&!(C()&e)))break t;if(!(A>>>0<i>>>0))break;A=A+1|0}return Nt(o,i,0,5,n),M=r,0|0}}while(0);return Tt(o,i,0,6,n),M=r,0|0}function $t(t,e){e|=0;var n=0,r=0,i=0,o=0,s=0,a=0,u=0;if((t|=0)>>>0>15)return 0|(a=4);if(ze(0|t,0,52),a=134225919|C(),!t){n=0,r=0;do{0|U(r)&&(ze(0|r,0,45),s=a|C(),A[(t=e+(n<<3)|0)>>2]=-1,A[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|U(s)){for(ze(0|s,0,45),r=1,i=-1,o=a|C();i&=~(u=0|ze(7,0,3*(15-r|0)|0)),o&=~C(),(0|r)!=(0|t);)r=r+1|0;A[(u=e+(n<<3)|0)>>2]=i,A[u+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Wt(t,e,n,r){t|=0,r|=0;var i=0,o=0;i=0|Qe(0|(e|=0),0|(n|=0),52),C(),!(0|e)&!(0|n)|(0|r)>15|(0|(i&=15))>(0|r)?(r=-1,i=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,I(0|(n=e)),0|r):(n=0|ze(-1,-1,3+(3*(r-n|0)|0)|0),r=0|ze(0|~n,0|~C(),3*(15-r|0)|0),n=~C()&e,r=~r&t,I(0|n),0|r)}(e,n,i+1|0,r),n=-15728641&C(),e=0|ze(0|r,0,52),r=(o=!(0|Bt(e|=o,n|=C())))?-1:r),A[(o=t)>>2]=e,A[o+4>>2]=n,A[t+8>>2]=i,A[t+12>>2]=r}function Kt(t){var e,n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0;if(!(!(0|(n=0|A[(r=t|=0)>>2]))&!(0|(r=0|A[r+4>>2]))||(i=0|Qe(0|n,0|r,52),C(),n=0|Me(0|(u=0|ze(1,0,3*(15^(i&=15))|0)),0|C(),0|n,0|r),r=0|C(),A[(u=t)>>2]=n,A[u+4>>2]=r,(0|i)<(0|(a=0|A[(u=t+8|0)>>2]))))){for(e=t+12|0,s=i;;){if((0|s)==(0|a)){i=5;break}if(c=(0|s)==(0|A[e>>2]),i=0|Qe(0|n,0|r,0|(o=3*(15-s|0)|0)),C(),c&1==(0|(i&=7))&!0){i=7;break}if(!(7==(0|i)&!0)){i=10;break}if(n=0|Me(0|n,0|r,0|(c=0|ze(1,0,0|o)),0|C()),r=0|C(),A[(c=t)>>2]=n,A[c+4>>2]=r,!((0|s)>(0|a))){i=10;break}s=s+-1|0}if(5==(0|i))return A[(c=t)>>2]=0,A[c+4>>2]=0,A[u>>2]=-1,void(A[e>>2]=-1);if(7==(0|i))return a=0|Me(0|n,0|r,0|(a=0|ze(1,0,0|o)),0|C()),u=0|C(),A[(c=t)>>2]=a,A[c+4>>2]=u,void(A[e>>2]=s+-1)}}function Zt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Jt(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<17453292519943298e-27?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Be(0|(n=0|le(7,0,t,((0|t)<0)<<31>>31)),0|C(),120,0),t=0|C(),A[e>>2]=2|n,A[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,A,o,s,a=0,u=0,l=0,d=0,g=0,m=0;return m=+i[(e|=0)>>3],o=+i[t>>3],g=+h(.5*(m-o)),l=+i[e+8>>3],A=+i[t+8>>3],d=+h(.5*(l-A)),r=+f(+o),s=+f(+m),d=2*+_(+ +c(+(d=g*g+d*(s*r*d))),+ +c(+(1-d))),g=+i[n>>3],m=+h(.5*(g-m)),a=+i[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*(A-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 re(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|Ht(t|=0,e|=0,r=s+168|0)))return M=s,0|(n=u);if(0|Xt(t,e,o)&&x(23313,22742,386,22751),(0|(e=0|A[o>>2]))>0){if(a=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{a+=+ne(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 i[n>>3]=a,M=s,0|(n=0)}function Ae(t){t|=0;var e,n,r=0;return(e=0|Te(1,12))||x(22832,22787,49,22845),0|(r=0|A[(n=t+4|0)>>2])?(A[(r=r+8|0)>>2]=e,A[n>>2]=e,0|e):(0|A[t>>2]&&x(22862,22787,61,22885),A[(r=t)>>2]=e,A[n>>2]=e,0|e)}function ie(t,e){t|=0,e|=0;var n,r;return(r=0|De(24))||x(22899,22787,78,22913),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[r+16>>2]=0,0|(n=0|A[(e=t+4|0)>>2])?(A[n+16>>2]=r,A[e>>2]=r,0|r):(0|A[t>>2]&&x(22928,22787,82,22913),A[t>>2]=r,A[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,i=0;if(t|=0)for(r=1;;){if(0|(e=0|A[t>>2]))do{if(0|(n=0|A[e>>2]))do{i=n,n=0|A[n+16>>2],Le(i)}while(0|n);i=e,e=0|A[e+8>>2],Le(i)}while(0|e);if(e=t,t=0|A[t+8>>2],r||Le(e),!t)break;r=0}}function se(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,E=0,w=0,b=0,I=0,C=0,N=0,S=0,D=0,L=0,T=0,M=0,O=0,R=0,P=0,k=0;if(0|A[(a=(t|=0)+8|0)>>2])return 0|(k=1);if(!(s=0|A[t>>2]))return 0|(k=0);r=s,o=0;do{o=o+1|0,r=0|A[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(k=0);(n=0|De(o<<2))||x(22948,22787,317,22967),(e=0|De(o<<5))||x(22989,22787,321,22967),A[t>>2]=0,A[(S=t+4|0)>>2]=0,A[a>>2]=0,o=0,R=0,N=0,g=0;t:for(;;){if(d=0|A[s>>2]){c=0,l=d;do{if(h=+i[l+8>>3],r=l,l=0|A[l+16>>2],f=+i[(a=(p=!(0|l))?d:l)+8>>3],+u(+(h-f))>3.141592653589793){k=14;break}c+=(f-h)*(+i[r>>3]+ +i[a>>3])}while(!p);if(14==(0|k)){k=0,c=0,r=d;do{C=+i[r+8>>3],M=0|A[(O=r+16|0)>>2],I=+i[(M=0|M?M:d)+8>>3],c+=(+i[r>>3]+ +i[M>>3])*((I<0?I+6.283185307179586:I)-(C<0?C+6.283185307179586:C)),r=0|A[(0|r?O:s)>>2]}while(0|r)}c>0?(A[n+(R<<2)>>2]=s,R=R+1|0,a=N,r=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!o){if(g){a=S,l=g+8|0,r=s,o=t;break}if(0|A[t>>2]){k=27;break t}a=S,l=t,r=s,o=t;break}if(0|A[(r=o+8|0)>>2]){k=21;break t}if(!(o=0|Te(1,12))){k=23;break t}A[r>>2]=o,a=o+4|0,l=o,r=g}while(0);if(A[l>>2]=s,A[a>>2]=s,l=e+(N<<5)|0,p=0|A[s>>2]){for(i[(d=e+(N<<5)+8|0)>>3]=17976931348623157e292,i[(g=e+(N<<5)+24|0)>>3]=17976931348623157e292,i[l>>3]=-17976931348623157e292,i[(y=e+(N<<5)+16|0)>>3]=-17976931348623157e292,w=17976931348623157e292,b=-17976931348623157e292,a=0,_=p,h=17976931348623157e292,v=17976931348623157e292,E=-17976931348623157e292,f=-17976931348623157e292;c=+i[_>>3],C=+i[_+8>>3],_=0|A[_+16>>2],I=+i[((m=!(0|_))?p:_)+8>>3],c<h&&(i[d>>3]=c,h=c),C<v&&(i[g>>3]=C,v=C),c>E?i[l>>3]=c:c=E,C>f&&(i[y>>3]=C,f=C),w=C>0&C<w?C:w,b=C<0&C>b?C:b,a|=+u(+(C-I))>3.141592653589793,!m;)E=c;a&&(i[y>>3]=b,i[g>>3]=w)}else A[l>>2]=0,A[l+4>>2]=0,A[l+8>>2]=0,A[l+12>>2]=0,A[l+16>>2]=0,A[l+20>>2]=0,A[l+24>>2]=0,A[l+28>>2]=0;a=N+1|0}if(s=0|A[(O=s+8|0)>>2],A[O>>2]=0,!s){k=45;break}N=a,g=r}if(21==(0|k))x(22765,22787,35,22799);else if(23==(0|k))x(22819,22787,37,22799);else if(27==(0|k))x(22862,22787,61,22885);else if(45==(0|k)){t:do{if((0|R)>0){for(O=!(0|a),T=a<<2,M=!(0|t),L=0,r=0;;){if(D=0|A[n+(L<<2)>>2],O)k=73;else{if(!(N=0|De(T))){k=50;break}if(!(S=0|De(T))){k=52;break}e:do{if(M)o=0;else{for(a=0,o=0,l=t;s=e+(a<<5)|0,0|ae(0|A[l>>2],s,0|A[D>>2])?(A[N+(o<<2)>>2]=l,A[S+(o<<2)>>2]=s,m=o+1|0):m=o,l=0|A[l+8>>2];)a=a+1|0,o=m;if((0|m)>0)if(s=0|A[N>>2],1==(0|m))o=s;else for(y=0,_=-1,o=s,g=s;;){for(p=0|A[g>>2],s=0,l=0;d=(0|(a=0|A[A[N+(l<<2)>>2]>>2]))==(0|p)?s:s+(1&ae(a,0|A[S+(l<<2)>>2],0|A[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|A[N+(s<<2)>>2]}else o=0}}while(0);if(Le(N),Le(S),o){if(s=0|A[(a=o+4|0)>>2])o=s+8|0;else if(0|A[o>>2]){k=70;break}A[o>>2]=D,A[a>>2]=D}else k=73}if(73==(0|k)){if(k=0,0|(r=0|A[D>>2]))do{S=r,r=0|A[r+16>>2],Le(S)}while(0|r);Le(D),r=1}if((0|(L=L+1|0))>=(0|R)){P=r;break t}}50==(0|k)?x(23004,22787,249,23023):52==(0|k)?x(23042,22787,252,23023):70==(0|k)&&x(22862,22787,61,22885)}else P=0}while(0);return Le(n),Le(e),0|(k=P)}return 0}function ae(t,e,n){t|=0;var r=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;if(!(0|X(e|=0,n|=0)))return 0|(t=0);if(e=0|H(e),r=+i[n>>3],o=e&(o=+i[n+8>>3])<0?o+6.283185307179586:o,!(t=0|A[t>>2]))return 0|(t=0);if(e){e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[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|A[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|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[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|A[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|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ue(t,e,n,i,o){n|=0,i|=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|Qe(0|(t|=0),0|(e|=0),52),C(),l&=15,y=0|Qe(0|n,0|i,52),C(),(0|l)!=(15&y))return M=c,0|(v=12);if(d=0|Qe(0|t,0|e,45),C(),d&=127,g=0|Qe(0|n,0|i,45),C(),d>>>0>121|(g&=127)>>>0>121)return M=c,0|(v=5);if(y=(0|d)!=(0|g)){if(7==(0|(h=0|j(d,g))))return M=c,0|(v=1);7==(0|(p=0|j(g,d)))?x(23066,23090,161,23100):(_=h,f=p)}else _=0,f=0;s=0|U(d),a=0|U(g),A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0;do{if(_){if(h=(0|(g=0|A[4272+(28*d|0)+(_<<2)>>2]))>0,a)if(h){d=0,p=n,h=i;do{p=0|Qt(p,h),h=0|C(),1==(0|(f=0|dt(f)))&&(f=0|dt(1)),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;else if(h){d=0,p=n,h=i;do{p=0|zt(p,h),h=0|C(),f=0|dt(f),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;if(Yt(d,p,v),y||x(23115,23090,191,23100),(h=!!(0|s))&(f=!!(0|a))&&x(23142,23090,192,23100),h){if(7==(0|(f=0|Ft(t,e)))){l=5;break}if(0|r[21872+(7*f|0)+_|0]){l=1;break}d=p=0|A[21040+(28*f|0)+(_<<2)>>2]}else if(f){if(7==(0|(f=0|Ft(d,p)))){l=5;break}if(0|r[21872+(7*f|0)+g|0]){l=1;break}d=0,p=0|A[21040+(28*g|0)+(f<<2)>>2]}else d=0,p=0;if((d|p)<0)l=5;else{if((0|p)>0){h=v+4|0,f=0;do{ht(h),f=f+1|0}while((0|f)!=(0|p))}if(A[u>>2]=0,A[u+4>>2]=0,A[u+8>>2]=0,lt(u,_),0|l)for(;0|Vt(l)?ut(u):ct(u),(0|l)>1;)l=l+-1|0;if((0|d)>0){l=0;do{ht(u),l=l+1|0}while((0|l)!=(0|d))}et(m=v+4|0,u,m),J(m),m=51}}else if(Yt(n,i,v),!!(0|s)&!!(0|a))if((0|g)!=(0|d)&&x(23173,23090,261,23100),7==(0|(f=0|Ft(t,e)))|7==(0|(l=0|Ft(n,i))))l=5;else if(0|r[21872+(7*f|0)+l|0])l=1;else if((0|(f=0|A[21040+(28*f|0)+(l<<2)>>2]))>0){h=v+4|0,l=0;do{ht(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,A[o>>2]=A[l>>2],A[o+4>>2]=A[l+4>>2],A[o+8>>2]=A[l+8>>2],l=0),M=c,0|(v=l)}function ce(t,e,n,r){n|=0,r|=0;var i,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,i=s+36|0,c=s+24|0,l=s+12|0,f=s,a=0|Qe(0|(t|=0),0|(e|=0),52),C(),a&=15,p=0|Qe(0|t,0|e,45),C(),(p&=127)>>>0>121)return M=s,0|(r=5);if(o=0|U(p),ze(0|a,0,52),y=134225919|C(),A[(u=r)>>2]=-1,A[u+4>>2]=y,!a)return 7==(0|(a=0|At(n)))||127==(0|(a=0|Y(p,a)))?(M=s,0|(y=1)):(d=0|ze(0|a,0,45),g=0|C(),g=-1040385&A[(p=r)+4>>2]|g,A[(y=r)>>2]=A[p>>2]|d,A[y+4>>2]=g,M=s,0|(y=0));for(A[i>>2]=A[n>>2],A[i+4>>2]=A[n+4>>2],A[i+8>>2]=A[n+8>>2],n=a;;){if(u=n,n=n+-1|0,A[c>>2]=A[i>>2],A[c+4>>2]=A[i+4>>2],A[c+8>>2]=A[i+8>>2],0|Vt(u)){if(0|(a=0|it(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ut(l)}else{if(0|(a=0|ot(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ct(l)}if(nt(c,l,f),J(f),m=0|A[(a=r)>>2],a=0|A[a+4>>2],_=0|ze(7,0,0|(v=3*(15-u|0)|0)),a&=~C(),v=0|ze(0|At(f),0,0|v),a=C()|a,A[(y=r)>>2]=v|m&~_,A[y+4>>2]=a,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|A[i>>2])<=1&&(0|A[i+4>>2])<=1&&(0|A[i+8>>2])<=1){f=127==(0|(a=0|Y(p,n=0|At(i))))?0:0|U(a);e:do{if(n){if(o){if(7==(0|(a=0|Ft(t,e)))){a=5;break t}if((0|(u=0|A[21248+(28*a|0)+(n<<2)>>2]))>0){a=n,n=0;do{a=0|pt(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|Y(p,a)))&&x(23200,23090,411,23230),0|U(n)?x(23245,23090,412,23230):(g=n,d=u,h=a)}else g=a,d=0,h=n;if((0|(l=0|A[4272+(28*p|0)+(h<<2)>>2]))<=-1&&x(23276,23090,419,23230),!f){if((0|d)<0){a=5;break t}if(0|d){a=0,n=0|A[(u=r)>>2],u=0|A[u+4>>2];do{n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[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|A[(u=r)>>2],u=0|A[u+4>>2];;)if(n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=u,(0|(a=a+1|0))==(0|l)){a=g,n=58;break e}}if(7==(0|(c=0|j(g,p)))&&x(23066,23090,428,23230),n=0|A[(a=r)>>2],a=0|A[a+4>>2],(0|l)>0){u=0;do{n=0|Ut(n,a),a=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=a,u=u+1|0}while((0|u)!=(0|l))}if(7==(0|(a=0|Ft(n,a)))&&x(23313,23090,440,23230),n=0|Q(g),(0|(n=0|A[(n?21664:21456)+(28*c|0)+(a<<2)>>2]))<0&&x(23313,23090,454,23230),n){a=0,u=0|A[(c=r)>>2],c=0|A[c+4>>2];do{u=0|Gt(u,c),c=0|C(),A[(v=r)>>2]=u,A[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|Ft(t,e)))|7==(0|(u=0|Ft(0|A[(u=r)>>2],0|A[u+4>>2])))){a=5;break t}if((0|(u=0|A[21248+(28*n|0)+(u<<2)>>2]))<0){a=5;break t}if(u){n=0,c=0|A[(l=r)>>2],l=0|A[l+4>>2];do{c=0|Ut(c,l),l=0|C(),A[(v=r)>>2]=c,A[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|Ft(0|A[(v=r)>>2],0|A[v+4>>2]))){a=9;break}_=0|A[(v=r)>>2],v=-1040385&A[v+4>>2],m=0|ze(0|a,0,45),v|=C(),A[(a=r)>>2]=_|m,A[a+4>>2]=v,a=0}else a=1}while(0);return M=s,0|(v=a)}function le(t,e,n,r){t|=0,e|=0;var A=0,i=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return i=1,I(0|(A=0)),0|i;i=t,A=e,t=1,e=0;do{t=0|Be(0|((o=!0&!(1&n))?1:i),0|(o?0:A),0|t,0|e),e=0|C(),n=0|Ue(0|n,0|r,1),r=0|C(),i=0|Be(0|i,0|A,0|i,0|A),A=0|C()}while(!(!(0|n)&!(0|r)));return I(0|e),0|t}function fe(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|X(e|=0,n|=0)))return 0|(p=0);if(e=0|H(e),o=+i[n>>3],s=e&(s=+i[n+8>>3])<0?s+6.283185307179586:s,(0|(p=0|A[t>>2]))<=0)return 0|(p=0);if(r=0|A[t+4>>2],e){e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[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=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[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 he(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,E=0;if(!(r=0|A[(t|=0)>>2]))return A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,void(A[e+28>>2]=0);if(i[(o=e+8|0)>>3]=17976931348623157e292,i[(s=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(a=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|A[t+4>>2],y=17976931348623157e292,_=-17976931348623157e292,m=0,t=-1,h=17976931348623157e292,p=17976931348623157e292,g=-17976931348623157e292,l=-17976931348623157e292,v=0;c=+i[n+(v<<4)>>3],d=+i[n+(v<<4)+8>>3],f=+i[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<h&&(i[o>>3]=c,h=c),d<p&&(i[s>>3]=d,p=d),c>g?i[e>>3]=c:c=g,d>l&&(i[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);)E=v,g=c,v=t,t=E;m&&(i[a>>3]=_,i[s>>3]=y)}}function pe(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,E=0,w=0,b=0,I=0,C=0,x=0;if(_=0|A[(t|=0)>>2]){if(i[(m=e+8|0)>>3]=17976931348623157e292,i[(v=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(E=e+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(s=0|A[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,o=0,r=-1,f=17976931348623157e292,h=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292,w=0;a=+i[s+(w<<4)>>3],p=+i[s+(w<<4)+8>>3],l=+i[s+(((0|(C=r+2|0))==(0|_)?0:C)<<4)+8>>3],a<f&&(i[m>>3]=a,f=a),p<h&&(i[v>>3]=p,h=p),a>d?i[e>>3]=a:a=d,p>c&&(i[E>>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|_);)C=w,d=a,w=r,r=C;o&&(i[E>>3]=y,i[v>>3]=g)}}else A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,A[e+28>>2]=0;if(!((0|(r=0|A[(C=t+8|0)>>2]))<=0)){n=t+12|0,I=0;do{if(s=0|A[n>>2],o=I,v=e+((I=I+1|0)<<5)|0,E=0|A[s+(o<<3)>>2]){if(i[(w=e+(I<<5)+8|0)>>3]=17976931348623157e292,i[(t=e+(I<<5)+24|0)>>3]=17976931348623157e292,i[v>>3]=-17976931348623157e292,i[(b=e+(I<<5)+16|0)>>3]=-17976931348623157e292,(0|E)>0){for(_=0|A[s+(o<<3)+4>>2],g=17976931348623157e292,y=-17976931348623157e292,s=0,o=-1,m=0,f=17976931348623157e292,h=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;a=+i[_+(m<<4)>>3],d=+i[_+(m<<4)+8>>3],l=+i[_+(((0|(o=o+2|0))==(0|E)?0:o)<<4)+8>>3],a<f&&(i[w>>3]=a,f=a),d<h&&(i[t>>3]=d,h=d),a>p?i[v>>3]=a:a=p,d>c&&(i[b>>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|E);)x=m,m=o,p=a,o=x;s&&(i[b>>3]=y,i[t>>3]=g)}}else A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0,A[v+16>>2]=0,A[v+20>>2]=0,A[v+24>>2]=0,A[v+28>>2]=0,r=0|A[C>>2]}while((0|I)<(0|r))}}function de(t,e,n){var r=0,i=0,o=0;if(!(0|fe(t|=0,e|=0,n|=0)))return 0|(i=0);if((0|A[(i=t+8|0)>>2])<=0)return 0|(i=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|fe((0|A[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|A[i>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function ge(t,e,n,r,A){e|=0,n|=0,r|=0,A|=0;var o,s,a,u,c,l,f,h=0;u=+i[(t|=0)>>3],a=+i[e>>3]-u,s=+i[t+8>>3],o=+i[e+8>>3]-s,l=+i[n>>3],h=((h=+i[r>>3]-l)*(s-(f=+i[n+8>>3]))-(u-l)*(c=+i[r+8>>3]-f))/(a*c-o*h),i[A>>3]=u+a*h,i[A+8>>3]=s+o*h}function ye(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function _e(t,e){e|=0;var n,r,A;return+((A=+i[(t|=0)>>3]-+i[e>>3])*A+(r=+i[t+8>>3]-+i[e+8>>3])*r+(n=+i[t+16>>3]-+i[e+16>>3])*n)}function me(t,e,n){n|=0;var r,i,o,s,a=0,u=0,c=0;if(s=M,M=M+32|0,c=s,0|(a=0|jt(t|=0,e|=0,i=s+16|0)))return M=s,0|(n=a);r=0|Ot(t,e),o=0|Ft(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,A[(e|=0)>>2]=A[t>>2],A[e+4>>2]=A[t+4>>2],A[e+8>>2]=A[t+8>>2],A[e+12>>2]=A[t+12>>2]}(r,c),a=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|A[11120+(216*e|0)>>2])!=(0|t))if((0|A[11120+(216*e|0)+8>>2])!=(0|t))if((0|A[11120+(216*e|0)+16>>2])!=(0|t))if((0|A[11120+(216*e|0)+24>>2])!=(0|t))if((0|A[11120+(216*e|0)+32>>2])!=(0|t))if((0|A[11120+(216*e|0)+40>>2])!=(0|t))if((0|A[11120+(216*e|0)+48>>2])!=(0|t))if((0|A[11120+(216*e|0)+56>>2])!=(0|t))if((0|A[11120+(216*e|0)+64>>2])!=(0|t))if((0|A[11120+(216*e|0)+72>>2])!=(0|t))if((0|A[11120+(216*e|0)+80>>2])!=(0|t))if((0|A[11120+(216*e|0)+88>>2])!=(0|t))if((0|A[11120+(216*e|0)+96>>2])!=(0|t))if((0|A[11120+(216*e|0)+104>>2])!=(0|t))if((0|A[11120+(216*e|0)+112>>2])!=(0|t))if((0|A[11120+(216*e|0)+120>>2])!=(0|t))if((0|A[11120+(216*e|0)+128>>2])!=(0|t)){if((0|A[11120+(216*e|0)+136>>2])!=(0|t)){if((0|A[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|A[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|A[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|A[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|A[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|A[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|A[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|A[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|A[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|A[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|A[i>>2]);t:do{if(0|U(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:a=1;break t}if(u=0|A[22e3+(24*t|0)+8>>2],e=0|A[22e3+(24*t|0)+16>>2],(0|(t=0|A[i>>2]))!=(0|A[c>>2])&&(c=0|Q(r))|(0|(t=0|A[i>>2]))==(0|e)&&(a=(a+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){a=(a+5|0)%6|0,u=22;break}5==(0|o)&(0|t)==(0|u)?(a=(a+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(A[n>>2]=a,a=0),M=s,0|(n=a)}function ve(t,e,n,r){n|=0,r|=0;var i,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,i=u,p=(p=!(0|Bt(t|=0,e|=0)))?6:5,g=0|Qe(0|t,0|e,52),C(),p>>>0<=n>>>0)return M=u,0|(r=2);!(y=!(0|(g&=15)))&&!((_=0|ze(7,0,3*(15^g)|0))&t)&!(C()&e)?c=n:l=4;t:do{if(4==(0|l)){if((0|((c=!!(0|Bt(t,e)))?4:5))<(0|n))return M=u,0|(r=1);if(0|me(t,e,v))return M=u,0|(r=1);if(l=(0|A[v>>2])+n|0,7==(0|(_=0|A[(c=c?22288+((0|l)%5<<2)|0:22320+((0|l)%6<<2)|0)>>2])))return M=u,0|(r=1);A[a>>2]=0,c=0|B(t,e,_,a,s);do{if(!c){if(d=0|A[(h=s)>>2],l=(f=(h=0|A[h+4>>2])>>>0<e>>>0|(0|h)==(0|e)&d>>>0<t>>>0)?d:t,f=f?h:e,!y&&!(d&(y=0|ze(7,0,3*(15^g)|0)))&!(h&C()))c=n;else{if(h=(n+-1+p|0)%(0|p)|0,c=0|Bt(t,e),(0|h)<0&&x(23313,23315,245,23324),(0|((p=!!(0|c))?4:5))<(0|h)&&x(23313,23315,245,23324),0|me(t,e,v)&&x(23313,23315,245,23324),c=(0|A[v>>2])+h|0,7==(0|(h=0|A[(c=p?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&x(23313,23315,245,23324),A[o>>2]=0,0|(c=0|B(t,e,h,o,i)))break;p=0|A[(d=i)>>2],d=0|A[d+4>>2];do{if(d>>>0<f>>>0|(0|d)==(0|f)&p>>>0<l>>>0){if(l=0|Bt(p,d)?0|F(p,d,t,e):0|A[22384+(((0|A[o>>2])+(0|A[22352+(h<<2)>>2])|0)%6<<2)>>2],c=0|Bt(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|me(p,d,v))){if(c){c=(5+(0|A[21936+(l<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(l<<2)>>2])-(0|A[v>>2])|0)%6|0;break}c=-1}while(0);l=p,f=d}else c=n}while(0);d=0|A[(h=s)>>2],h=0|A[h+4>>2]}if((0|l)==(0|d)&(0|f)==(0|h)){if(t=(p=!!(0|Bt(d,h)))?0|F(d,h,t,e):0|A[22384+(((0|A[a>>2])+(0|A[22352+(_<<2)>>2])|0)%6<<2)>>2],c=0|Bt(d,h),(t+-1|0)>>>0<=5&&!(1==(0|t)&(m=!!(0|c))))do{if(!(0|me(d,h,v))){if(m){c=(5+(0|A[21936+(t<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(t<<2)>>2])-(0|A[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|ze(0|c,0,56),v=C()|-2130706433&e|536870912,A[r>>2]=m|t,A[r+4>>2]=v,M=u,0|(r=0)}function Ee(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Te(e,4),A[t>>2]=r,r||x(23337,23360,40,23374)):A[t>>2]=0,A[t+4>>2]=e,A[t+8>>2]=0,A[t+12>>2]=n}function we(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|A[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(a=0|A[t>>2],c=0|A[a+(o<<2)>>2])break;o=o+1|0}o=a+(~~(+u(+ +l(10,+ +(15-(0|A[n>>2])|0))*(+i[c>>3]+ +i[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|A[o>>2];e:do{if(0|s){if(a=c+32|0,(0|s)==(0|c))A[o>>2]=A[a>>2];else{if(!(o=0|A[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|A[(s=o+32|0)>>2]))break e;A[s>>2]=A[a>>2]}Le(c),A[r>>2]=(0|A[r>>2])-1}}while(0)}Le(0|A[t>>2])}function be(t){var e,n=0,r=0;for(e=0|A[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|A[(0|A[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function Ie(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,n=(0|A[t>>2])+(n<<2)|0,!(r=0|A[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|A[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|A[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){A[r+32>>2]=A[s>>2];break}if(10==(0|o))return 0|n}else A[n>>2]=A[s>>2]}while(0);return Le(e),A[(s=t+8|0)>>2]=(0|A[s>>2])-1,0|(s=0)}function Ce(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,a=0;(r=0|De(40))||x(23390,23360,98,23403),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[(s=r+16|0)>>2]=A[n>>2],A[s+4>>2]=A[n+4>>2],A[s+8>>2]=A[n+8>>2],A[s+12>>2]=A[n+12>>2],A[r+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|A[t+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,s=(0|A[t>>2])+(s<<2)|0,o=0|A[s>>2];do{if(o){for(;!(0|Jt(o,e)&&0|Jt(o+16|0,n));)if(s=0|A[o+32>>2],!(0|A[(o=0|s?s:o)+32>>2])){a=10;break}if(10==(0|a)){A[o+32>>2]=r;break}return Le(r),0|(a=o)}A[s>>2]=r}while(0);return A[(a=t+8|0)>>2]=1+(0|A[a>>2]),0|(a=r)}function xe(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(o=0|A[(0|A[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|Jt(t,e)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|Jt(t,e)&&0|Jt(t+16|0,n)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Ne(t,e){e|=0;var n=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(t=0|A[(0|A[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Jt(t,e)){e=5;break}if(!(t=0|A[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Se(t){return 0|+function(t){return+ +Xe(+(t=+t))}(t=+t)}function De(t){t|=0;var e,n=0,r=0,i=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,E=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|A[5857])>>>t))return i=0|A[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|A[(o=i+8|0)>>2]))==(0|t)?A[5857]=h&~(1<<n):(A[s+12>>2]=t,A[r>>2]=s),w=n<<3,A[i+4>>2]=3|w,A[(w=i+w+4|0)>>2]=1|A[w>>2],M=e,0|(w=o);if(l>>>0>(f=0|A[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|A[(t=(n=23468+((i=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(i=(n>>>=t)>>>1&1))+(n>>>i)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|A[(u=s+8|0)>>2]))==(0|n)?(t=h&~(1<<i),A[5857]=t):(A[r+12>>2]=n,A[t>>2]=r,t=h),a=(w=i<<3)-l|0,A[s+4>>2]=3|l,A[(o=s+l|0)+4>>2]=1|a,A[s+w>>2]=a,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=a,A[5862]=o,M=e,0|(w=u);if(s=0|A[5858]){for(r=(s&0-s)-1|0,r=c=0|A[23732+(((i=(r>>>=o=r>>>12&16)>>>5&8)|o|(a=(r>>>=i)>>>2&4)|(u=(r>>>=a)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&A[c+4>>2])-l|0;(t=0|A[r+16>>2])||(t=0|A[r+20>>2]);)r=t,u=(o=(a=(-8&A[t+4>>2])-l|0)>>>0<c>>>0)?t:u,c=o?a:c;if((a=u+l|0)>>>0>u>>>0){o=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){r=0;break}for(;;)if(r=0|A[(i=n+20|0)>>2])n=r,t=i;else{if(!(r=0|A[(i=n+16|0)>>2]))break;n=r,t=i}A[t>>2]=0,r=n}else r=0|A[u+8>>2],A[r+12>>2]=n,A[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|A[u+28>>2],(0|u)==(0|A[(t=23732+(n<<2)|0)>>2])){if(A[t>>2]=r,!r){A[5858]=s&~(1<<n);break}}else if(A[((0|A[(w=o+16|0)>>2])==(0|u)?w:o+20)>>2]=r,!r)break;A[r+24>>2]=o,0|(n=0|A[u+16>>2])&&(A[r+16>>2]=n,A[n+24>>2]=r),0|(n=0|A[u+20>>2])&&(A[r+20>>2]=n,A[n+24>>2]=r)}}while(0);return c>>>0<16?(w=c+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2]):(A[u+4>>2]=3|l,A[a+4>>2]=1|c,A[a+c>>2]=c,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,(n=1<<n)&h?n=0|A[(t=r+8|0)>>2]:(A[5857]=n|h,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=c,A[5862]=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),i=0|A[5858]){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|A[23732+(c<<2)>>2];t:do{if(r)for(t=0,u=l<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((a=(-8&A[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|A[r+20>>2]))|(0|y)==(0|(r=0|A[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)&i)){h=l;break}h=(t&0-t)-1|0,t=0,r=0|A[23732+(((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&A[s+4>>2])-l|0)>>>0<o>>>0)?h:o,t=r?s:t,(r=0|A[s+16>>2])||(r=0|A[s+20>>2]),!r){u=t,a=o;break}s=r}if(0|u&&a>>>0<((0|A[5859])-l|0)>>>0&&(f=u+l|0)>>>0>u>>>0){s=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){n=0;break}for(;;)if(r=0|A[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|A[(o=n+16|0)>>2]))break;n=r,t=o}A[t>>2]=0}else w=0|A[u+8>>2],A[w+12>>2]=n,A[n+8>>2]=w}while(0);do{if(s){if(t=0|A[u+28>>2],(0|u)==(0|A[(r=23732+(t<<2)|0)>>2])){if(A[r>>2]=n,!n){i&=~(1<<t),A[5858]=i;break}}else if(A[((0|A[(w=s+16|0)>>2])==(0|u)?w:s+20)>>2]=n,!n)break;A[n+24>>2]=s,0|(t=0|A[u+16>>2])&&(A[n+16>>2]=t,A[t+24>>2]=n),(t=0|A[u+20>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);t:do{if(a>>>0<16)w=a+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2];else{if(A[u+4>>2]=3|l,A[f+4>>2]=1|a,A[f+a>>2]=a,n=a>>>3,a>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=f,A[n+12>>2]=f,A[f+8>>2]=n,A[f+12>>2]=r;break}if(n=23732+((r=(n=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(r=((w<<=v)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,A[f+28>>2]=r,A[(t=f+16|0)+4>>2]=0,A[t>>2]=0,!(i&(t=1<<r))){A[5858]=i|t,A[n>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break}n=0|A[n>>2];e:do{if((-8&A[n+4>>2])!=(0|a)){for(i=a<<(31==(0|r)?0:25-(r>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|a)){n=t;break e}i<<=1,n=t}A[r>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=f,A[E>>2]=f,A[f+8>>2]=w,A[f+12>>2]=n,A[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|A[5859])>>>0>=h>>>0)return n=r-h|0,t=0|A[5862],n>>>0>15?(w=t+h|0,A[5862]=w,A[5859]=n,A[w+4>>2]=1|n,A[t+r>>2]=n,A[t+4>>2]=3|h):(A[5859]=0,A[5862]=0,A[t+4>>2]=3|r,A[(w=t+r+4|0)>>2]=1|A[w>>2]),M=e,0|(w=t+8|0);if((a=0|A[5860])>>>0>h>>>0)return v=a-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0);if(0|A[5975]?t=0|A[5977]:(A[5977]=4096,A[5976]=4096,A[5978]=-1,A[5979]=-1,A[5980]=0,A[5968]=0,A[5975]=-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|A[5967])&&(p=(f=0|A[5965])+l|0)>>>0<=f>>>0|p>>>0>t>>>0)return M=e,0|(w=0);t:do{if(4&A[5968])n=0,y=143;else{r=0|A[5863];e:do{if(r){for(i=23876;!((p=0|A[i>>2])>>>0<=r>>>0&&(p+(0|A[i+4>>2])|0)>>>0>r>>>0);){if(!(t=0|A[i+8>>2])){y=128;break e}i=t}if((n=s-a&o)>>>0<2147483647)if((0|(t=0|$e(0|n)))==((0|A[i>>2])+(0|A[i+4>>2])|0)){if(-1!=(0|t)){a=n,s=t,y=145;break t}}else i=t,y=136;else n=0}else y=128}while(0);do{if(128==(0|y))if(-1!=(0|(r=0|$e(0)))&&(n=r,g=(n=((g=(d=0|A[5976])+-1|0)&n?(g+n&0-d)-n|0:0)+l|0)+(d=0|A[5965])|0,n>>>0>h>>>0&n>>>0<2147483647)){if(0|(p=0|A[5967])&&g>>>0<=d>>>0|g>>>0>p>>>0){n=0;break}if((0|(t=0|$e(0|n)))==(0|r)){a=n,s=r,y=145;break t}i=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|i))){if(-1==(0|i)){n=0;break}a=n,s=i,y=145;break t}if((t=c-n+(t=0|A[5977])&0-t)>>>0>=2147483647){a=n,s=i,y=145;break t}if(-1==(0|$e(0|t))){$e(0|r),n=0;break}a=t+n|0,s=i,y=145;break t}}while(0);A[5968]=4|A[5968],y=143}}while(0);if(143==(0|y)&&l>>>0<2147483647&&!(-1==(0|(v=0|$e(0|l)))|1^(m=(_=(g=0|$e(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|A[5965])+a|0,A[5965]=n,n>>>0>(0|A[5966])>>>0&&(A[5966]=n),c=0|A[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|A[n>>2])+(r=0|A[n+4>>2])|0)){y=154;break}if(!(i=0|A[n+8>>2]))break;n=i}if(!(154!=(0|y)||(E=n+4|0,8&A[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){A[E>>2]=r+a,E=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(w=(0|A[5860])+a|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[c+w+4>>2]=40,A[5864]=A[5979];break}for(s>>>0<(0|A[5861])>>>0&&(A[5861]=s),r=s+a|0,n=23876;;){if((0|A[n>>2])==(0|r)){y=162;break}if(!(t=0|A[n+8>>2]))break;n=t}if(162==(0|y)&&!(8&A[n+12>>2])){A[n>>2]=s,A[(f=n+4|0)>>2]=(0|A[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,A[f+4>>2]=3|h;e:do{if((0|c)==(0|n))w=(0|A[5860])+u|0,A[5860]=w,A[5863]=l,A[l+4>>2]=1|w;else{if((0|A[5862])==(0|n)){w=(0|A[5859])+u|0,A[5859]=w,A[5862]=l,A[l+4>>2]=1|w,A[l+w>>2]=w;break}if(1==(3&(t=0|A[n+4>>2]))){a=-8&t,i=t>>>3;n:do{if(t>>>0<256){if(t=0|A[n+8>>2],(0|(r=0|A[n+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<i);break}A[t+12>>2]=r,A[r+8>>2]=t;break}s=0|A[n+24>>2],t=0|A[n+12>>2];do{if((0|t)==(0|n)){if(t=0|A[(i=(r=n+16|0)+4|0)>>2])r=i;else if(!(t=0|A[r>>2])){t=0;break}for(;;)if(i=0|A[(o=t+20|0)>>2])t=i,r=o;else{if(!(i=0|A[(o=t+16|0)>>2]))break;t=i,r=o}A[r>>2]=0}else w=0|A[n+8>>2],A[w+12>>2]=t,A[t+8>>2]=w}while(0);if(!s)break;i=23732+((r=0|A[n+28>>2])<<2)|0;do{if((0|A[i>>2])==(0|n)){if(A[i>>2]=t,0|t)break;A[5858]=A[5858]&~(1<<r);break n}if(A[((0|A[(w=s+16|0)>>2])==(0|n)?w:s+20)>>2]=t,!t)break n}while(0);if(A[t+24>>2]=s,0|(i=0|A[(r=n+16|0)>>2])&&(A[t+16>>2]=i,A[i+24>>2]=t),!(r=0|A[r+4>>2]))break;A[t+20>>2]=r,A[r+24>>2]=t}while(0);n=n+a|0,o=a+u|0}else o=u;if(A[(n=n+4|0)>>2]=-2&A[n>>2],A[l+4>>2]=1|o,A[l+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=l,A[n+12>>2]=l,A[l+8>>2]=n,A[l+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){i=31;break}i=o>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1}else i=0}while(0);if(n=23732+(i<<2)|0,A[l+28>>2]=i,A[(t=l+16|0)+4>>2]=0,A[t>>2]=0,!((t=0|A[5858])&(r=1<<i))){A[5858]=t|r,A[n>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break}n=0|A[n>>2];n:do{if((-8&A[n+4>>2])!=(0|o)){for(i=o<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|o)){n=t;break n}i<<=1,n=t}A[r>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break e}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=l,A[E>>2]=l,A[l+8>>2]=w,A[l+12>>2]=n,A[l+24>>2]=0}}while(0);return M=e,0|(w=f+8|0)}for(n=23876;!((t=0|A[n>>2])>>>0<=c>>>0&&(w=t+(0|A[n+4>>2])|0)>>>0>c>>>0);)n=0|A[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,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(r=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+r+4>>2]=40,A[5864]=A[5979],A[(r=t+4|0)>>2]=27,A[n>>2]=A[5969],A[n+4>>2]=A[5970],A[n+8>>2]=A[5971],A[n+12>>2]=A[5972],A[5969]=s,A[5970]=a,A[5972]=0,A[5971]=n,n=t+24|0;do{E=n,A[(n=n+4|0)>>2]=7}while((E+8|0)>>>0<w>>>0);if((0|t)!=(0|c)){if(s=t-c|0,A[r>>2]=-2&A[r>>2],A[c+4>>2]=1|s,A[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=c,A[n+12>>2]=c,A[c+8>>2]=n,A[c+12>>2]=r;break}if(r=23732+((i=(n=s>>>8)?s>>>0>16777215?31:s>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,A[c+28>>2]=i,A[c+20>>2]=0,A[o>>2]=0,!((n=0|A[5858])&(t=1<<i))){A[5858]=n|t,A[r>>2]=c,A[c+24>>2]=r,A[c+12>>2]=c,A[c+8>>2]=c;break}n=0|A[r>>2];e:do{if((-8&A[n+4>>2])!=(0|s)){for(i=s<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|s)){n=t;break e}i<<=1,n=t}A[r>>2]=c,A[c+24>>2]=n,A[c+12>>2]=c,A[c+8>>2]=c;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=c,A[E>>2]=c,A[c+8>>2]=w,A[c+12>>2]=n,A[c+24>>2]=0}}else!(0|(w=0|A[5861]))|s>>>0<w>>>0&&(A[5861]=s),A[5969]=s,A[5970]=a,A[5972]=0,A[5866]=A[5975],A[5865]=-1,A[5870]=23468,A[5869]=23468,A[5872]=23476,A[5871]=23476,A[5874]=23484,A[5873]=23484,A[5876]=23492,A[5875]=23492,A[5878]=23500,A[5877]=23500,A[5880]=23508,A[5879]=23508,A[5882]=23516,A[5881]=23516,A[5884]=23524,A[5883]=23524,A[5886]=23532,A[5885]=23532,A[5888]=23540,A[5887]=23540,A[5890]=23548,A[5889]=23548,A[5892]=23556,A[5891]=23556,A[5894]=23564,A[5893]=23564,A[5896]=23572,A[5895]=23572,A[5898]=23580,A[5897]=23580,A[5900]=23588,A[5899]=23588,A[5902]=23596,A[5901]=23596,A[5904]=23604,A[5903]=23604,A[5906]=23612,A[5905]=23612,A[5908]=23620,A[5907]=23620,A[5910]=23628,A[5909]=23628,A[5912]=23636,A[5911]=23636,A[5914]=23644,A[5913]=23644,A[5916]=23652,A[5915]=23652,A[5918]=23660,A[5917]=23660,A[5920]=23668,A[5919]=23668,A[5922]=23676,A[5921]=23676,A[5924]=23684,A[5923]=23684,A[5926]=23692,A[5925]=23692,A[5928]=23700,A[5927]=23700,A[5930]=23708,A[5929]=23708,A[5932]=23716,A[5931]=23716,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(w=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+w+4>>2]=40,A[5864]=A[5979]}while(0);if((n=0|A[5860])>>>0>h>>>0)return v=n-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0)}return A[(w=23424)>>2]=12,M=e,0|(w=0)}function Le(t){var e=0,n=0,r=0,i=0,o=0,s=0,a=0,u=0;if(t|=0){n=t+-8|0,i=0|A[5861],u=n+(e=-8&(t=0|A[t+-4>>2]))|0;do{if(1&t)a=n,s=n;else{if(r=0|A[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<i>>>0)return;if((0|A[5862])==(0|s)){if(3&~(e=0|A[(t=u+4|0)>>2])){a=s,e=o;break}return A[5859]=o,A[t>>2]=-2&e,A[s+4>>2]=1|o,void(A[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|A[s+8>>2],(0|(e=0|A[s+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<n),a=s,e=o;break}A[t+12>>2]=e,A[e+8>>2]=t,a=s,e=o;break}i=0|A[s+24>>2],t=0|A[s+12>>2];do{if((0|t)==(0|s)){if(t=0|A[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){t=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0}else a=0|A[s+8>>2],A[a+12>>2]=t,A[t+8>>2]=a}while(0);if(i){if(e=0|A[s+28>>2],(0|A[(n=23732+(e<<2)|0)>>2])==(0|s)){if(A[n>>2]=t,!t){A[5858]=A[5858]&~(1<<e),a=s,e=o;break}}else if(A[((0|A[(a=i+16|0)>>2])==(0|s)?a:i+20)>>2]=t,!t){a=s,e=o;break}A[t+24>>2]=i,0|(n=0|A[(e=s+16|0)>>2])&&(A[t+16>>2]=n,A[n+24>>2]=t),(e=0|A[e+4>>2])?(A[t+20>>2]=e,A[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|A[(t=u+4|0)>>2])){if(2&r)A[t>>2]=-2&r,A[a+4>>2]=1|e,A[s+e>>2]=e,i=e;else{if((0|A[5863])==(0|u)){if(u=(0|A[5860])+e|0,A[5860]=u,A[5863]=a,A[a+4>>2]=1|u,(0|a)!=(0|A[5862]))return;return A[5862]=0,void(A[5859]=0)}if((0|A[5862])==(0|u))return u=(0|A[5859])+e|0,A[5859]=u,A[5862]=s,A[a+4>>2]=1|u,void(A[s+u>>2]=u);i=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|A[u+8>>2],(0|(t=0|A[u+12>>2]))==(0|e)){A[5857]=A[5857]&~(1<<n);break}A[e+12>>2]=t,A[t+8>>2]=e;break}o=0|A[u+24>>2],t=0|A[u+12>>2];do{if((0|t)==(0|u)){if(t=0|A[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){n=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0,n=t}else n=0|A[u+8>>2],A[n+12>>2]=t,A[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|A[u+28>>2],(0|A[(e=23732+(t<<2)|0)>>2])==(0|u)){if(A[e>>2]=n,!n){A[5858]=A[5858]&~(1<<t);break}}else if(A[((0|A[(r=o+16|0)>>2])==(0|u)?r:o+20)>>2]=n,!n)break;A[n+24>>2]=o,0|(e=0|A[(t=u+16|0)>>2])&&(A[n+16>>2]=e,A[e+24>>2]=n),0|(t=0|A[t+4>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);if(A[a+4>>2]=1|i,A[s+i>>2]=i,(0|a)==(0|A[5862]))return void(A[5859]=i)}if(t=i>>>3,i>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|A[5857])&(t=1<<t)?t=0|A[(e=n+8|0)>>2]:(A[5857]=e|t,t=n,e=n+8|0),A[e>>2]=a,A[t+12>>2]=a,A[a+8>>2]=t,void(A[a+12>>2]=n);t=23732+((r=(t=i>>>8)?i>>>0>16777215?31:i>>>((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,A[a+28>>2]=r,A[a+20>>2]=0,A[a+16>>2]=0,e=0|A[5858],n=1<<r;t:do{if(e&n){t=0|A[t>>2];e:do{if((-8&A[t+4>>2])!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1));e=0|A[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&A[e+4>>2])==(0|i)){t=e;break e}r<<=1,t=e}A[n>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a;break t}}while(0);u=0|A[(s=t+8|0)>>2],A[u+12>>2]=a,A[s>>2]=a,A[a+8>>2]=u,A[a+12>>2]=t,A[a+24>>2]=0}else A[5858]=e|n,A[t>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a}while(0);if(u=(0|A[5865])-1|0,A[5865]=u,!(0|u)){for(t=23884;t=0|A[t>>2];)t=t+8|0;A[5865]=-1}}}}function Te(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|De(n))&&3&A[t+-4>>2]?(He(0|t,0,0|n),0|t):0|t}function Me(t,e,n,r){return 0|(I((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(I(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Re(t){return 0|((t|=0)?31-(0|b(t^t-1)):32)}function Pe(t,e,n,r,i){i|=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|i),a?o?(A[i>>2]=0|t,A[i+4>>2]=0,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i)):(o&&(A[i>>2]=(l>>>0)%(s>>>0),A[i+4>>2]=0),i=(l>>>0)/(s>>>0)>>>0,0|(I(0|(h=0)),i));o=!(0|a);do{if(s){if(!o){if((o=(0|b(0|a))-(0|b(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 i?(A[i>>2]=0|t,A[i+4>>2]=0|u,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i))}if((o=s-1|0)&s){s=a=33+(0|b(0|s))-(0|b(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|i&&(A[i>>2]=o&l,A[i+4>>2]=0),1==(0|s)?(d=0|t,0|(I(0|(p=0|u)),d)):(p=c>>>((d=0|Re(0|s))>>>0)|0,d=c<<32-d|l>>>(d>>>0),0|(I(0|p),d))}if(o)return 0|i&&(A[i>>2]=(c>>>0)%(s>>>0),A[i+4>>2]=0),d=(c>>>0)/(s>>>0)>>>0,0|(I(0|(p=0)),d);if(!l)return 0|i&&(A[i>>2]=0,A[i+4>>2]=(c>>>0)%(a>>>0)),d=(c>>>0)/(a>>>0)>>>0,0|(I(0|(p=0)),d);if(!((o=a-1|0)&a))return 0|i&&(A[i>>2]=0|t,A[i+4>>2]=o&c),p=0,d=c>>>((0|Re(0|a))>>>0),0|(I(0|p),d);if((o=(0|b(0|a))-(0|b(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 i?(A[i>>2]=0|t,A[i+4>>2]=0|u,d=0,0|(I(0|(p=0)),d)):(d=0,0|(I(0|(p=0)),d))}while(0);if(s){c=0|Me(0|(f=0|n),0|(l=0|h),-1,-1),n=0|C(),u=a,a=0;do{r=u,u=o>>>31|u<<1,o=a|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(h=t>>>31|e<<1)),a=1&(p=(d=0|C())>>31|((0|d)<0?-1:0)<<1),t=0|Oe(0|r,0|h,p&f,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l),e=0|C(),s=s-1|0}while(0|s);c=u,u=0}else c=a,u=0,a=0;return s=0,0|i&&(A[i>>2]=t,A[i+4>>2]=e),d=o<<1&-2|a,0|(I(0|(p=(0|o)>>>31|(c|s)<<1|u)),d)}function ke(t,e,n,r){n|=0;var A,i,o,s,a;return i=(r|=0)>>31|((0|r)<0?-1:0)<<1,A=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|s),t=i^a,e=A^s,0|Oe(Pe(o,0|C(),0|Oe(i^n,A^r,0|i,0|A),0|C(),0)^t,C()^e,0|t,0|e)}function Be(t,e,n,r){e|=0,r|=0;var A,i;return n=0|function(t,e){var n,r,A,i=0;return t=((n=0|v(i=65535&(e|=0),A=65535&(t|=0)))>>>16)+(0|v(i,r=t>>>16))|0,e=0|v(i=e>>>16,A),0|(I((t>>>16)+(0|v(i,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(A=t|=0,i=n|=0),t=0|C(),0|(I((0|v(e,i))+(0|v(r,A))+t|0),n)}function Fe(t,e,n,r){n|=0;var i,o,s,a,u,c;return i=M,M=M+16|0,a=0|i,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Pe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|C(),0|Oe(c^n,u^r,0|c,0|u),0|C(),a),r=0|Oe(A[a>>2]^s,A[a+4>>2]^o,0|s,0|o),n=0|C(),M=i,0|(I(0|n),r)}function Ge(t,e,n,r){var i,o;return o=M,M=M+16|0,Pe(t|=0,e|=0,n|=0,r|=0,i=0|o),M=o,0|(I(0|A[i+4>>2]),A[i>>2])}function Ue(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(I(0|((0|e)<0?-1:0)),e>>n-32)}function Qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(I(0),e>>>n-32|0)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(I(t<<n-32),0)}function Ve(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+w(+t,+e)}function qe(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+E(+t,+e)}function Ye(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function je(t,e,n){t|=0,e|=0;var i,o,s=0;if((0|(n|=0))>=8192)return D(0|t,0|e,0|n),0|t;if(o=0|t,i=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&i)-64|0;(0|t)<=(0|s);)A[t>>2]=A[e>>2],A[t+4>>2]=A[e+4>>2],A[t+8>>2]=A[e+8>>2],A[t+12>>2]=A[e+12>>2],A[t+16>>2]=A[e+16>>2],A[t+20>>2]=A[e+20>>2],A[t+24>>2]=A[e+24>>2],A[t+28>>2]=A[e+28>>2],A[t+32>>2]=A[e+32>>2],A[t+36>>2]=A[e+36>>2],A[t+40>>2]=A[e+40>>2],A[t+44>>2]=A[e+44>>2],A[t+48>>2]=A[e+48>>2],A[t+52>>2]=A[e+52>>2],A[t+56>>2]=A[e+56>>2],A[t+60>>2]=A[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)A[t>>2]=A[e>>2],t=t+4|0,e=e+4|0}else for(n=i-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|i);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function He(t,e,n){e|=0;var i,o=0,s=0,a=0;if(i=(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&i)-64|0;(0|t)<=(0|s);)A[t>>2]=a,A[t+4>>2]=a,A[t+8>>2]=a,A[t+12>>2]=a,A[t+16>>2]=a,A[t+20>>2]=a,A[t+24>>2]=a,A[t+28>>2]=a,A[t+32>>2]=a,A[t+36>>2]=a,A[t+40>>2]=a,A[t+44>>2]=a,A[t+48>>2]=a,A[t+52>>2]=a,A[t+56>>2]=a,A[t+60>>2]=a,t=t+64|0;for(;(0|t)<(0|o);)A[t>>2]=a,t=t+4|0}for(;(0|t)<(0|i);)r[t|0]=e,t=t+1|0;return i-n|0}function Xe(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function $e(t){t|=0;var e,n,r;return r=0|S(),(0|t)>0&(0|(e=(n=0|A[s>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),N(12),-1):(0|e)>(0|r)&&!(0|L(0|e))?(N(12),-1):(A[s>>2]=e,0|n)}return{___divdi3:ke,___muldi3:Be,___remdi3:Fe,___uremdi3:Ge,_areNeighborCells:function(t,e,n,r,i){i|=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|(i=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return A[i>>2]=0,M=a,0|(i=0);if(c=0|Qe(0|t,0|e,52),C(),c&=15,f=0|Qe(0|n,0|r,52),C(),(0|c)!=(15&f))return M=a,0|(i=12);if(u=c+-1|0,c>>>0>1){Pt(t,e,u,s),Pt(n,r,u,o),l=0|A[(f=s)>>2],f=0|A[f+4>>2];t:do{if((0|l)==(0|A[o>>2])&&(0|f)==(0|A[o+4>>2])){u=0|Qe(0|t,0|e,0|(c=3*(15^c)|0)),C(),u&=7,c=0|Qe(0|n,0|r,0|c),C(),c&=7;do{if(!(0|u)|!(0|c))A[i>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|Bt(l,f)){u=5;break}if((0|A[15536+(u<<2)>>2])!=(0|c)&&(0|A[15568+(u<<2)>>2])!=(0|c))break t;A[i>>2]=1,u=0}}while(0);return M=a,0|(i=u)}}while(0)}c=(u=s)+56|0;do{A[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return O(t,e,1,s),u=(0|A[(e=s)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+8|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+16|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+24|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+32|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+40|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)?1:1&((0|A[(u=s+48|0)>>2])==(0|n)?(0|A[u+4>>2])==(0|r):0),A[i>>2]=u,M=a,0|(i=0)},_bitshift64Ashr:Ue,_bitshift64Lshr:Qe,_bitshift64Shl:ze,_calloc:Te,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Xt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var i=0;return i=0|Qe(0|(t|=0),0|(e|=0),52),C(),(0|n)<16&(0|(i&=15))<=(0|n)?((0|i)<(0|n)&&(i=0|ze(-1,-1,3+(3*(n+-1-i|0)|0)|0),i=0|ze(0|~i,0|~C(),3*(15-n|0)|0),e=~C()&e,t&=~i),i=0|ze(0|n,0,52),n=-15728641&e|C(),A[r>>2]=t|i,A[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var i,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(i=M,M=M+16|0,_=i,m=0|Qe(0|(t|=0),0|(e|=0),52),C(),m&=15,n>>>0>15)return M=i,0|(m=4);if((0|m)<(0|n))return M=i,0|(m=12);if((0|m)!=(0|n))if(s=0|ze(0|n,0,52),s|=t,u=C()|-15728641&e,(0|m)>(0|n)){c=n;do{y=0|ze(7,0,3*(14-c|0)|0),c=c+1|0,s|=y,u=C()|u}while((0|c)<(0|m));y=s}else y=s;else y=t,u=e;g=0|Qe(0|y,0|u,45),C();t:do{if(0|U(127&g)){if(c=0|Qe(0|y,0|u,52),C(),0|(c&=15))for(s=1;;){if(!(!((g=0|ze(7,0,3*(15-s|0)|0))&y)&!(C()&u))){l=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(A[(g=r)>>2]=0,A[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|ze(0|d,0,52),s|=t,c=C()|g,(0|m)<(0|p))h=s;else{l=d;do{h=0|ze(7,0,3*(14-l|0)|0),l=l+1|0,s|=h,c=C()|c}while((0|l)<(0|m));h=s}else h=t,c=e;if(f=0|Qe(0|h,0|c,45),C(),0|U(127&f)){f=0|Qe(0|h,0|c,52),C(),f&=15;e:do{if(f)for(l=1;;){if(s=0|Qe(0|h,0|c,3*(15-l|0)|0),C(),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|Qe(0|t,0|e,3*(15-p|0)|0),C(),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|le(7,0,l=m-p|0,((0|l)<0)<<31>>31),f=0|C(),s?(s=0|Me(0|(s=0|Be(0|l,0|f,5,0)),0|C(),-5,-1),s=0|Me(0|(s=0|ke(0|s,0|C(),6,0)),0|C(),1,0),c=0|C()):(s=l,c=f),p=0|Me(0|s,0|c,0|(p=0|Be(0|l,0|f,0|(p=h+-1|0),((0|p)<0)<<31>>31)),0|C()),f=0|Me(0|p,0|(h=0|C()),0|A[(f=r)>>2],0|A[f+4>>2]),h=0|C(),A[(p=r)>>2]=f,A[p+4>>2]=h),(0|d)<=(0|n)){l=37;break}}if(19==(0|l))x(23313,22674,1099,22710);else{if(37==(0|l)){o=0|A[(a=r)+4>>2],a=0|A[a>>2];break}if(42==(0|l))return M=i,0|o}}else o=0,a=0}else l=33}while(0);t:do{if(33==(0|l)){if(A[(g=r)>>2]=0,A[g+4>>2]=0,(0|m)>(0|n)){for(s=m;;){if(o=0|Qe(0|t,0|e,3*(15-s|0)|0),C(),7==(0|(o&=7))){o=5;break}if(o=0|Be(0|(a=0|le(7,0,a=m-s|0,((0|a)<0)<<31>>31)),0|C(),0|o,0),a=0|C(),a=0|Me(0|A[(g=r)>>2],0|A[g+4>>2],0|o,0|a),o=0|C(),A[(g=r)>>2]=a,A[g+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return M=i,0|o}o=0,a=0}}while(0);return 0|kt(y,u,m,_)&&x(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&a>>>0>4294967295)&((0|(_=0|A[(m=_)+4>>2]))>(0|o)|((0|_)==(0|o)?(0|A[m>>2])>>>0>a>>>0:0))?(M=i,0|(m=0)):(x(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var i,o,s=0,a=0;if(o=M,M=M+16|0,Wt(i=o,t|=0,e|=0,n|=0),!(0|(t=0|A[(e=i)>>2]))&!(0|(e=0|A[e+4>>2])))return M=o,0;s=0,n=0;do{A[(a=r+(s<<3)|0)>>2]=t,A[a+4>>2]=e,s=0|Me(0|s,0|n,1,0),n=0|C(),Kt(i),t=0|A[(a=i)>>2],e=0|A[a+4>>2]}while(!(!(0|t)&!(0|e)));return M=o,0},_cellToChildrenSize:kt,_cellToLatLng:Ht,_cellToLocalIj:function(t,e,n,r,A,i){var o,s;return t|=0,e|=0,n|=0,r|=0,i|=0,s=M,M=M+16|0,o=s,(A|=0)?t=15:(t=0|ue(t,e,n,r,o))||(mt(o,i),t=0),M=s,0|t},_cellToParent:Pt,_cellToVertex:ve,_cellToVertexes:function(t,e,n){n|=0;var r,i=0,o=0;return o=!(0|Bt(t|=0,e|=0)),r=!(0|(i=0|ve(t,e,0,n))),o?r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||(i=0|ve(t,e,4,n+32|0))?0|(o=i):0|ve(t,e,5,n+40|0):0|(o=i):r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||0|(i=0|ve(t,e,4,n+32|0))?0|(o=i):(A[(o=n+40|0)>>2]=0,A[o+4>>2]=0,0|(o=0)):0|(o=i)},_cellsToDirectedEdge:function(t,e,n,r,i){return i|=0,7==(0|(n=0|F(t|=0,e|=0,n|=0,r|=0)))?0|(i=11):(r=0|ze(0|n,0,56),e=-2130706433&e|C()|268435456,A[i>>2]=t|r,A[i+4>>2]=e,0|(i=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,i,o,s=0;if(o=M,M=M+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+176|0,r=i,(0|(e|=0))<1)return Ee(n,0,0),M=i,0;for(c=0|Qe(0|A[(c=t)>>2],0|A[c+4>>2],52),C(),Ee(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Xt(0|A[(o=t+(c<<3)|0)>>2],0|A[o+4>>2],r)));){if((0|(o=0|A[r>>2]))>0){u=0;do{a=r+8+(u<<4)|0,(s=0|xe(n,o=r+8+((0|(u=u+1|0))%(0|o)<<4)|0,a))?Ie(n,s):Ce(n,a,o),o=0|A[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=i,0|o):(we(n),M=i,0|(l=o))}(t|=0,e|=0,i=o+16|0),0|t)return M=o,0|(n=t);if(A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,0|(t=0|be(i)))do{e=0|Ae(n);do{ie(e,t),s=t+16|0,A[r>>2]=A[s>>2],A[r+4>>2]=A[s+4>>2],A[r+8>>2]=A[s+8>>2],A[r+12>>2]=A[s+12>>2],Ie(i,t),t=0|Ne(i,r)}while(0|t);t=0|be(i)}while(0|t);return we(i),(t=0|se(n))?(oe(n),M=o,0|(s=t)):(M=o,0|(s=0))},_childPosToCell:function(t,e,n,r,i,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,(i|=0)>>>0>15)return M=s,0|(o=4);if(u=0|Qe(0|(n|=0),0|(r|=0),52),C(),(0|(u&=15))>(0|i))return M=s,0|(o=12);if(0|kt(n,r,i,a)&&x(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(l=0|A[(f=a)+4>>2]))>(0|e)|((0|l)==(0|e)?(0|A[f>>2])>>>0>t>>>0:0))))return M=s,0|(o=2);f=i-u|0,i=0|ze(0|i,0,52),c=C()|-15728641&r,A[(l=o)>>2]=i|n,A[l+4>>2]=c,l=0|Qe(0|n,0|r,45),C();t:do{if(0|U(127&l)){if(0|u)for(a=1;;){if(!(!((l=0|ze(7,0,3*(15-a|0)|0))&n)&!(C()&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|le(7,0,u=f-c|0,((0|u)<0)<<31>>31),n=0|C();do{if(a){if(a=0|ke(0|(a=0|Me(0|(a=0|Be(0|u,0|n,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(i=0|C()))|(0|e)==(0|i)&t>>>0>a>>>0){e=0|Oe(0|(e=0|Me(0|t,0|e,-1,-1)),0|C(),0|a,0|i),a=0|C(),d=0|A[(h=o)>>2],h=0|A[h+4>>2],p=0|ze(7,0,0|(g=3*(l+r|0)|0)),h&=~C(),g=0|ze(0|(i=0|Me(0|(r=0|ke(0|e,0|a,0|u,0|n)),0|(t=0|C()),2,0)),0|C(),0|g),h=C()|h,A[(i=o)>>2]=g|d&~p,A[i+4>>2]=h,t=0|Oe(0|e,0|a,0|(t=0|Be(0|r,0|t,0|u,0|n)),0|C()),a=0,e=0|C();break}p=0|A[(g=o)>>2],g=0|A[g+4>>2],d=0|ze(7,0,3*(l+r|0)|0),g&=~C(),A[(a=o)>>2]=p&~d,A[a+4>>2]=g,a=1;break}i=0|A[(p=o)>>2],p=0|A[p+4>>2],h=0|ze(7,0,0|(r=3*(l+r|0)|0)),p&=~C(),r=0|ze(0|(g=0|ke(0|t,0|e,0|u,0|n)),0|(a=0|C()),0|r),p=C()|p,A[(d=o)>>2]=r|i&~h,A[d+4>>2]=p,t=0|Oe(0|t,0|e,0|(a=0|Be(0|g,0|a,0|u,0|n)),0|C()),a=0,e=0|C()}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(i=15^u,a=1;;){if(d=0|le(7,0,d=f-a|0,((0|d)<0)<<31>>31),g=0|C(),n=0|A[(c=o)>>2],c=0|A[c+4>>2],r=0|ze(7,0,0|(u=3*(i-a|0)|0)),c&=~C(),u=0|ze(0|(h=0|ke(0|t,0|e,0|d,0|g)),0|(p=0|C()),0|u),c=C()|c,A[(l=o)>>2]=u|n&~r,A[l+4>>2]=c,t=0|Oe(0|t,0|e,0|(g=0|Be(0|h,0|p,0|d,0|g)),0|C()),e=0|C(),(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 i,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,E=0,w=0,b=0,I=0,N=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(I=0);if(s=0|A[(o=t|=0)>>2],!0&!(15728640&(o=0|A[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(I=0);if(A[(I=e)>>2]=s,A[I+4>>2]=o,1==(0|n)&!(0|r))return 0|(I=0);o=1;do{b=0|A[(w=t+(o<<3)|0)+4>>2],A[(I=e+(o<<3)|0)>>2]=A[w>>2],A[I+4>>2]=b,o=o+1|0}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(b=0|De(i=n<<3)))return 0|(I=13);if(je(0|b,0|t,0|i),!(w=0|Te(n,8)))return Le(b),0|(I=13);t:do{if(0|n){e:for(;;){v=0|Qe(0|(m=0|A[(o=b)>>2]),0|(o=0|A[o+4>>2]),52),C(),E=(v&=15)+-1|0,_=(0|n)>0;n:do{if(!!(0|v)&_){if(d=((0|n)<0)<<31>>31,g=0|ze(0|E,0,52),y=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){I=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(y=0|A[(r=b+(s<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){o=r,I=17;break e}}}for(s=0,t=m,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){I=22;break e}if(u=0|Qe(0|t,0|r,52),C(),(0|(u&=15))<(0|E)){o=12,I=28;break e}if((0|u)!=(0|E)&&(t|=g,r=-15728641&r|y,u>>>0>=v>>>0)){a=E;do{p=0|ze(7,0,3*(14-a|0)|0),a=a+1|0,t|=p,r=C()|r}while(a>>>0<u>>>0)}if(a=0|Ge(0|t,0|r,0|n,0|d),C(),!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2])))a=l;else for(p=0;;){if((0|p)>(0|n)){I=32;break e}if((0|c)==(0|t)&(-117440513&u)==(0|r)){f=0|Qe(0|c,0|u,56),C(),h=(f&=7)+1|0,N=0|Qe(0|c,0|u,45),C();r:do{if(0|U(127&N)){if(c=0|Qe(0|c,0|u,52),C(),!(c&=15)){u=6;break}for(u=1;;){if(!(!((N=0|ze(7,0,3*(15-u|0)|0))&t)&!(C()&r))){u=7;break r}if(!(u>>>0<c>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((f+2|0)>>>0>u>>>0){I=42;break e}N=0|ze(0|h,0,56),r=C()|-117440513&r,A[(h=l)>>2]=0,A[h+4>>2]=0,t|=N}else a=(a+1|0)%(0|n)|0;if(!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2]))){a=l;break}p=p+1|0}A[(N=a)>>2]=t,A[N+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|A[(r=b+(s<<3)|0)>>2],r=0|A[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){I=85;break}if(!(y=0|Te((0|n)/6|0,8))){I=49;break}n:do{if(_){p=0,h=0;do{if(!(!(0|(s=0|A[(r=u=w+(p<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){c=0|Qe(0|s,0|r,56),C(),t=(c&=7)+1|0,l=-117440513&r,N=0|Qe(0|s,0|r,45),C();r:do{if(0|U(127&N)){if(f=0|Qe(0|s,0|r,52),C(),0|(f&=15))for(a=1;;){if(!(!(s&(N=0|ze(7,0,3*(15-a|0)|0)))&!(l&C())))break r;if(!(a>>>0<f>>>0))break;a=a+1|0}s|=r=0|ze(0|t,0,56),r=C()|l,A[(t=u)>>2]=s,A[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(A[(N=y+(h<<3)|0)>>2]=s,A[N+4>>2]=-117440513&r,h=h+1|0)}p=p+1|0}while((0|p)!=(0|n));if(_){if(p=((0|n)<0)<<31>>31,d=0|ze(0|E,0,52),g=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){o=4,I=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=h;break n}if(!(!(0|A[(N=b+(o<<3)|0)>>2])&!(0|A[N+4>>2]))){o=4,I=84;break e}}}for(f=0,s=0,l=m;;){do{if(!(!(0|l)&!(0|o))){if(u=0|Qe(0|l,0|o,52),C(),(0|(u&=15))<(0|E)){o=12,I=84;break e}do{if((0|u)==(0|E))r=l,u=o;else{if(r=l|d,t=-15728641&o|g,u>>>0<v>>>0){u=t;break}a=E;do{N=0|ze(7,0,3*(14-a|0)|0),a=a+1|0,r|=N,t=C()|t}while(a>>>0<u>>>0);u=t}}while(0);for(a=0|Ge(0|r,0|u,0|n,0|p),C(),t=0;;){if((0|t)>(0|n)){I=77;break e}if((-117440513&(c=0|A[(N=w+(a<<3)|0)+4>>2]))==(0|u)&&(0|A[N>>2])==(0|r)){I=79;break}if((0|A[(N=w+((a=(a+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|A[N+4>>2])==(0|u))break;t=t+1|0}if(79==(0|I)&&(I=0,!0&100663296==(117440512&c)))break;A[(N=e+(s<<3)|0)>>2]=l,A[N+4>>2]=o,s=s+1|0}}while(0);if((0|(o=f+1|0))>=(0|n)){o=h;break n}f=o,l=0|A[(N=b+(o<<3)|0)>>2],o=0|A[N+4>>2]}}else s=0,o=h}else s=0,o=0}while(0);if(He(0|w,0,0|i),je(0|b,0|y,o<<3),Le(y),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|I))!0&!(117440512&o)?(o=4,I=28):I=22;else if(32==(0|I))x(23313,22674,362,22684);else{if(42==(0|I))return Le(b),Le(w),0|(N=10);if(49==(0|I))return Le(b),Le(w),0|(N=13);if(77==(0|I))x(23313,22674,462,22684);else{if(84==(0|I))return Le(y),Le(b),Le(w),0|(N=o);if(85==(0|I)){je(0|e,0|b,n<<3);break}}}if(22==(0|I))return Le(b),Le(w),0|(N=5);if(28==(0|I))return Le(b),Le(w),0|(N=o)}}while(0);return Le(b),Le(w),0|(N=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:bt,_directedEdgeToCells:function(t,e,n){t|=0;var r,i,o,s=0;return r=M,M=M+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(i=-2130706433&e|134217728,A[(o=n|=0)>>2]=t,A[o+4>>2]=i,A[s>>2]=0,e=0|Qe(0|t,0|e,56),C(),s=0|B(t,i,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|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[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 i[n>>3]=a,u=0,d=a,d*=6371.007180918475,i[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|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[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 i[n>>3]=a,u=0,d=a,d*=6371.007180918475,d*=1e3,i[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|bt(t|=0,e|=0,u=r)))return M=r,0|(u=t);if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return M=r,0|(u=0);e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[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 i[n>>3]=a,M=r,0|(u=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),A=new Int32Array(t),i=new Float64Array(t),n=t,!0},_free:Le,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,i,o=0;return r=M,M=M+16|0,A[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(i=0|Qe(0|t,0|e,56),C(),o=0|B(t,-2130706433&e|134217728,7&i,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))?(A[n>>2]=t,A[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;i=M,M=M+128|0,f=i+112|0,a=i+96|0,h=i,s=0|Qe(0|(e|=0),0|(n|=0),52),C(),c=15&s,A[f>>2]=c,u=0|Qe(0|e,0|n,45),C(),u&=127;t:do{if(0|U(u)){if(0|c)for(o=1;;){if(!(!((l=0|ze(7,0,3*(15-o|0)|0))&e)&!(C()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return l=0|ze(c+1|0,0,52),h=C()|-15728641&n,h=0|t((l|e)&~(f=0|ze(7,0,3*(14-c|0)|0)),h&~C(),r),M=i,0|h;s=1}else s=0}while(0);if(!(o=0|jt(e,n,a))){s?(St(a,f,h),l=5):(Mt(a,f,h),l=6);t:do{if(0|U(u))if(c)for(o=1;;){if(!(!((u=0|ze(7,0,3*(15-o|0)|0))&e)&!(C()&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);He(0|r,-1,e<<2);t:do{if(s)for(a=0;;){if(Lt(u=h+(a<<4)|0,0|A[f>>2]),u=0|A[u>>2],-1==(0|(c=0|A[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|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}else for(a=0;;){if(Dt(u=h+(a<<4)|0,0|A[f>>2],0,1),u=0|A[u>>2],-1==(0|(c=0|A[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|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}}while(0)}return M=i,0|(h=o)},_getNumCells:ee,_getPentagons:$t,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{ze(0|e,0,45),r=134225919|C(),A[(n=t+(e<<3)|0)>>2]=-1,A[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[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,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:R,_gridDistance:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s,a=0,u=0;return s=M,M=M+32|0,u=s,0|(o=0|ue(t|=0,e|=0,t,e,a=s+12|0))?(M=s,0|(u=o)):0|(t=0|ue(t,e,n,r,u))?(M=s,0|(u=t)):(a=0|_t(a,u),A[(u=i)>>2]=a,A[u+4>>2]=((0|a)<0)<<31>>31,M=s,0|(u=0))},_gridPathCells:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,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,E=0,w=0,b=0,I=0,N=0,S=0;if(o=M,M=M+48|0,c=o+12|0,N=o,!(s=0|ue(t|=0,e|=0,t,e,a=o+24|0))&&!(s=0|ue(t,e,n,r,c))){I=((0|(b=0|_t(a,c)))<0)<<31>>31,A[a>>2]=0,A[a+4>>2]=0,A[a+8>>2]=0,A[c>>2]=0,A[c+4>>2]=0,A[c+8>>2]=0,0|ue(t,e,t,e,a)&&x(23313,23090,691,23299),0|ue(t,e,n,r,c)&&x(23313,23090,696,23299),Et(a),Et(c),b?(y=+(0|b),w=a,r=p=0|A[a>>2],s=d=0|A[(v=a+4|0)>>2],n=g=0|A[(E=a+8|0)>>2],_=+((0|A[c>>2])-p|0)/y,m=+((0|A[c+4>>2])-d|0)/y,y=+((0|A[c+8>>2])-g|0)/y):(v=s=a+4|0,E=n=a+8|0,w=a,r=0|A[a>>2],s=0|A[s>>2],n=0|A[n>>2],_=0,m=0,y=0),A[N>>2]=r,A[(g=N+4|0)>>2]=s,A[(d=N+8|0)>>2]=n;t:do{if((0|b)<0)s=0;else for(h=0,p=0,s=r;;){S=_*(f=+(p>>>0)+4294967296*+(0|h))+ +(0|s),l=m*f+ +(0|A[v>>2]),f=y*f+ +(0|A[E>>2]),n=~~+Ye(+S),a=~~+Ye(+l),s=~~+Ye(+f),S=+u(+(+(0|n)-S)),l=+u(+(+(0|a)-l)),f=+u(+(+(0|s)-f));do{if(!(S>l&S>f)){if(c=0-n|0,l>f){r=c-s|0;break}r=a,s=c-a|0;break}n=0-(a+s)|0,r=a}while(0);if(A[N>>2]=n,A[g>>2]=r,A[d>>2]=s,wt(N),0|(s=0|ce(t,e,N,i+(p<<3)|0)))break t;if(!((0|h)<(0|I)|(0|h)==(0|I)&p>>>0<b>>>0)){s=0;break t}s=0|Me(0|p,0|h,1,0),h=c=0|C(),p=s,s=0|A[w>>2]}}while(0);return M=o,0|(N=s)}return M=o,0|(N=s)},_gridPathCellsSize:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s=0,a=0,u=0;return o=M,M=M+32|0,u=o,(s=0|ue(t|=0,e|=0,t,e,a=o+12|0))||(s=0|ue(t,e,n,r,u))?(M=o,0|(u=s)):(r=0|Me(0|(r=0|_t(a,u)),((0|r)<0)<<31>>31,1,0),a=0|C(),A[(u=i)>>2]=r,A[u+4>>2]=a,M=o,0|(u=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var i,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,A[(p=i=o)>>2]=t,A[p+4>>2]=e,!n)return A[(d=r)>>2]=t,A[d+4>>2]=e,M=o,0|(d=0);A[d>>2]=0;t:do{if(0|Bt(t,e))t=9;else{if(a=(0|n)>0){s=0,p=t;do{if(0|(t=0|B(p,e,4,d,i)))break t;if(s=s+1|0,0|Bt(p=0|A[(e=i)>>2],e=0|A[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(A[(h=r)>>2]=p,A[h+4>>2]=e,h=n+-1|0,a){f=0,t=1;do{if(s=22384+(f<<2)|0,5==(0|f))for(u=0|A[s>>2],a=0,s=t;;){if(0|(t=0|B(0|A[(t=i)>>2],0|A[t+4>>2],u,d,i)))break t;if((0|a)!=(0|h)){if(c=0|A[(l=i)>>2],l=0|A[l+4>>2],A[(t=r+(s<<3)|0)>>2]=c,A[t+4>>2]=l,0|Bt(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=i,l=0|A[s>>2],c=0,s=t,a=0|A[u>>2],u=0|A[u+4>>2];;){if(0|(t=0|B(a,u,l,d,i)))break t;if(a=0|A[(u=i)>>2],u=0|A[u+4>>2],A[(t=r+(s<<3)|0)>>2]=a,A[t+4>>2]=u,t=s+1|0,0|Bt(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);u=p,s=0|A[(t=i)>>2],a=e,t=0|A[t+4>>2]}else u=p,s=p,a=e,t=e}else A[(u=r)>>2]=t,A[u+4>>2]=e,u=t,s=t,a=e,t=e;t=(0|u)==(0|s)&(0|a)==(0|t)?0:9}}while(0);return M=o,0|(d=t)},_i64Add:Me,_i64Subtract:Oe,_isPentagon:Bt,_isResClassIII:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),1&e},_isValidCell:Rt,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|Qe(0|(t|=0),0|(e|=0),56),C(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Bt(t,n))?0|(n=0):0|(n=0|Rt(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,i=0,o=0;return r=M,M=M+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|Rt(t,i=-2130706433&e|134217728)?(o=0|Qe(0|t,0|e,56),C(),i=(o=!(0|ve(t,i,7&o,n)))&((0|A[(i=n)>>2])==(0|t)?(0|A[i+4>>2])==(0|e):0)&1,M=r,0|i):(M=r,0|(i=0))},_latLngToCell:qt,_llvm_maxnum_f64:Ve,_llvm_minnum_f64:qe,_llvm_round_f64:Ye,_localIjToCell:function(t,e,n,r,A){var i,o;return t|=0,e|=0,n|=0,A|=0,o=M,M=M+16|0,i=o,(r|=0)?n=15:(n=0|vt(n,i))||(n=0|ce(t,e,i,A)),M=o,0|n},_malloc:De,_maxFaceCount:function(t,e,n){n|=0;var r=0,i=0;if(i=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&i)))return i=2,A[n>>2]=i,0;if(i=0|Qe(0|t,0|e,52),C(),!(i&=15))return i=5,A[n>>2]=i,0;for(r=1;;){if(!(!((0|ze(7,0,3*(15-r|0)|0))&t)&!(C()&e))){r=2,t=6;break}if(!(r>>>0<i>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(A[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,i=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(i=0|Be(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|C(),n=0|Me(0|t,0|n,1,0),n=0|Me(0|(n=0|Be(0|i,0|r,0|n,0|C())),0|C(),1,0),t=0|C(),A[e>>2]=n,A[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var i,o=0,s=0,a=0,u=0,c=0;if(i=M,M=M+48|0,o=i+16|0,s=i+8|0,a=i,0|(n|=0))return M=i,0|(a=15);if(u=0|A[(c=t|=0)+4>>2],A[(n=s)>>2]=A[c>>2],A[n+4>>2]=u,he(s,o),!(e=0|$(o,e,a))){if(n=0|A[s>>2],(0|(s=0|A[t+8>>2]))>0){o=0|A[t+12>>2],e=0;do{n=(0|A[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|A[(e=a)>>2],(0|(e=0|A[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(A[(e=a)>>2]=n,A[e+4>>2]=s,e=s):n=o,u=0|Me(0|n,0|e,12,0),c=0|C(),A[(e=a)>>2]=u,A[e+4>>2]=c,A[(e=r)>>2]=u,A[e+4>>2]=c,e=0}return M=i,0|(c=e)},_memcpy:je,_memset:He,_originToDirectedEdges:function(t,e,n){n|=0;var r,i=0;return r=!(0|Bt(t|=0,e|=0)),e&=-2130706433,A[(i=n)>>2]=r?t:0,A[i+4>>2]=r?285212672|e:0,A[(i=n+8|0)>>2]=t,A[i+4>>2]=301989888|e,A[(i=n+16|0)>>2]=t,A[i+4>>2]=318767104|e,A[(i=n+24|0)>>2]=t,A[i+4>>2]=335544320|e,A[(i=n+32|0)>>2]=t,A[i+4>>2]=352321536|e,A[(n=n+40|0)>>2]=t,A[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var i,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,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,R=0,B=0,F=0,U=0;if(a=M,M=M+112|0,i=a+80|0,h=a+72|0,o=a,s=a+56|0,0|(n|=0))return M=a,0|(U=15);if(!(U=0|De(32+(A[(p=(t|=0)+8|0)>>2]<<5)|0)))return M=a,0|(U=13);if(pe(t,U),F=0|A[(B=t)+4>>2],A[(n=h)>>2]=A[B>>2],A[n+4>>2]=F,he(h,i),n=0|$(i,e,o))B=0,F=0;else{if(n=0|A[h>>2],(0|(c=0|A[p>>2]))>0){l=0|A[t+12>>2],u=0;do{n=(0|A[l+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|c));u=n}else u=n;c=0|A[(n=o)>>2],(0|(n=0|A[n+4>>2]))<(0|(l=((0|u)<0)<<31>>31))|(0|n)==(0|l)&c>>>0<u>>>0?(A[(n=o)>>2]=u,A[n+4>>2]=l,n=l):u=c,B=0|Me(0|u,0|n,12,0),F=0|C(),A[(n=o)>>2]=B,A[n+4>>2]=F,n=0}if(0|n)return Le(U),M=a,0|(U=n);if(!(u=0|Te(B,8)))return Le(U),M=a,0|(U=13);if(!(f=0|Te(B,8)))return Le(U),Le(u),M=a,0|(U=13);A[(O=i)>>2]=0,A[O+4>>2]=0,R=0|A[(O=t)+4>>2],A[(n=h)>>2]=A[O>>2],A[n+4>>2]=R,n=0|G(h,B,F,e,i,u,f);t:do{if(n)Le(u),Le(f),Le(U);else{e:do{if((0|A[p>>2])>0){for(l=t+12|0,c=0;n=0|G((0|A[l>>2])+(c<<3)|0,B,F,e,i,u,f),c=c+1|0,!(0|n);)if((0|c)>=(0|A[p>>2]))break e;Le(u),Le(f),Le(U);break t}}while(0);(0|F)>0|!(0|F)&B>>>0>0&&He(0|f,0,B<<3),O=0|A[(R=i)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|A[R>>2])>>>0>0){D=u,L=f,T=u,O=f,R=u,n=u,x=u,N=f,S=f,u=f;n:for(;;){for(E=0,w=0,b=0,I=0,c=0,l=0;;){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));if(0|P(p=0|A[(e=D+(E<<3)|0)>>2],e=0|A[e+4>>2],1,o,0)){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));0|(f=0|Te(7,4))&&(k(p,e,1,o,f,7,0,0),Le(f))}for(v=0;;){_=0|A[(m=o+(v<<3)|0)>>2],m=0|A[m+4>>2];r:do{if(!(0|_)&!(0|m))f=c,h=l;else{if(d=0|Ge(0|_,0|m,0|B,0|F),p=0|C(),!(!(0|(h=0|A[(e=f=r+(d<<3)|0)>>2]))&!(0|(e=0|A[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|Fe(0|(f=0|Me(0|d,0|p,1,0)),0|C(),0|B,0|F),p=0|C(),y=0|Me(0|y,0|g,1,0),g=0|C(),h=0|A[(e=f=r+(d<<3)|0)>>2],e=0|A[e+4>>2]}while(!(!(0|h)&!(0|e)))}!(0|_)&!(0|m)?(f=c,h=l):(Ht(_,m,s),0|de(t,U,s)&&(y=0|Me(0|c,0|l,1,0),l=0|C(),A[(g=f)>>2]=_,A[g+4>>2]=m,A[(c=L+(c<<3)|0)>>2]=_,A[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(E=0|Me(0|E,0|w,1,0),w=0|C(),b=0|Me(0|b,0|I,1,0),I=0|C(),c=0|A[(l=i)>>2],!((0|I)<(0|(l=0|A[l+4>>2]))|(0|I)==(0|l)&b>>>0<c>>>0))break;c=f,l=h}if((0|l)>0|!(0|l)&c>>>0>0){c=0,l=0;do{A[(I=D+(c<<3)|0)>>2]=0,A[I+4>>2]=0,c=0|Me(0|c,0|l,1,0),l=0|C(),b=0|A[(I=i)+4>>2]}while((0|l)<(0|b)|((0|l)==(0|b)?c>>>0<(0|A[I>>2])>>>0:0))}if(A[(I=i)>>2]=f,A[I+4>>2]=h,!((0|h)>0|!(0|h)&f>>>0>0))break e;v=u,E=S,w=R,b=N,I=L,u=x,S=n,N=T,x=v,n=E,R=O,O=w,T=b,L=D,D=I}Le(T),Le(O),Le(U),n=1;break t}n=f}while(0);Le(U),Le(u),Le(n),n=0}}while(0);return M=a,0|(U=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|A[(t|=0)>>2])>>>0)+4294967296*+(0|A[t+4>>2]))},_res0CellCount:function(){return 122},_round:Xe,_sbrk:$e,_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,i,o,s){t|=0,r|=0,i|=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|Qe(0|(c=0|A[(l=t+(p<<3)|0)>>2]),0|(l=0|A[l+4>>2]),52),C(),(15&f)>(0|s)){u=12,c=11;break}if(Wt(g,c,l,s),!(0|(l=0|A[(f=g)>>2]))&!(0|(f=0|A[f+4>>2])))c=h;else{c=h;do{if(!((0|u)<(0|o)|(0|u)==(0|o)&c>>>0<i>>>0)){c=10;break t}A[(h=r+(c<<3)|0)>>2]=l,A[h+4>>2]=f,c=0|Me(0|c,0|u,1,0),u=0|C(),Kt(g),l=0|A[(h=g)>>2],f=0|A[h+4>>2]}while(!(!(0|l)&!(0|f)))}if(p=0|Me(0|p,0|d,1,0),!((0|(d=0|C()))<(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,i){t|=0,e|=0,n|=0,r|=0,i|=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|A[(l=t+(f<<3)|0)>>2]))&!(0|(l=0|A[l+4>>2]))||(l=!(0|kt(c,l,r,o)),u=0|Me(0|A[(c=o)>>2],0|A[c+4>>2],0|u,0|a),a=0|C(),l))){a=12;break}if(f=0|Me(0|f,0|h,1,0),!((0|(h=0|C()))<(0|n)|(0|h)==(0|n)&f>>>0<e>>>0))break t}return M=s,0|a}u=0,a=0}while(0);return A[i>>2]=u,A[i+4>>2]=a,M=s,0|(i=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,i,o,s,a=0,u=0;return s=M,M=M+192|0,i=s,o=s+168|0,a=0|Qe(0|(t|=0),0|(e|=0),56),C(),a&=7,0|(r=0|jt(t,u=-2130706433&e|134217728,o))?(M=s,0|(u=r)):(e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,u)?Nt(o,e,a,1,i):Tt(o,e,a,1,i),u=i+8|0,A[n>>2]=A[u>>2],A[n+4>>2]=A[u+4>>2],A[n+8>>2]=A[u+8>>2],A[n+12>>2]=A[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},{a:yt,b:function(t){y=t},c:function(){return y},d:function(t,e,n,r){yt("Assertion failed: "+L(t)+", at: "+[e?L(e):"unknown filename",n,r?L(r):"unknown function"])},e:function(t){return n.___errno_location&&(x[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){I.set(I.subarray(e,e+n),t)},h:function(t){var e=J(),n=16777216,r=2130706432;if(t>r)return!1;for(var A=Math.max(e,16777216);A<t;)A=A<=536870912?T(2*A,n):Math.min(T((3*A+2147483648)/4,n),r);return!!tt(A)},i:function(t){yt("OOM")},j:W,k:K,l:tt,m:Z,n:function(){var t=Z();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),K(t)},o:24144,p:24128},w);n.___divdi3=At.___divdi3,n.___muldi3=At.___muldi3,n.___remdi3=At.___remdi3,n.___uremdi3=At.___uremdi3,n._areNeighborCells=At._areNeighborCells,n._bitshift64Ashr=At._bitshift64Ashr,n._bitshift64Lshr=At._bitshift64Lshr,n._bitshift64Shl=At._bitshift64Shl,n._calloc=At._calloc,n._cellAreaKm2=At._cellAreaKm2,n._cellAreaM2=At._cellAreaM2,n._cellAreaRads2=At._cellAreaRads2,n._cellToBoundary=At._cellToBoundary,n._cellToCenterChild=At._cellToCenterChild,n._cellToChildPos=At._cellToChildPos,n._cellToChildren=At._cellToChildren,n._cellToChildrenSize=At._cellToChildrenSize,n._cellToLatLng=At._cellToLatLng,n._cellToLocalIj=At._cellToLocalIj,n._cellToParent=At._cellToParent,n._cellToVertex=At._cellToVertex,n._cellToVertexes=At._cellToVertexes,n._cellsToDirectedEdge=At._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=At._cellsToLinkedMultiPolygon,n._childPosToCell=At._childPosToCell,n._compactCells=At._compactCells,n._destroyLinkedMultiPolygon=At._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=At._directedEdgeToBoundary,n._directedEdgeToCells=At._directedEdgeToCells,n._edgeLengthKm=At._edgeLengthKm,n._edgeLengthM=At._edgeLengthM,n._edgeLengthRads=At._edgeLengthRads;var it=n._emscripten_replace_memory=At._emscripten_replace_memory;n._free=At._free,n._getBaseCellNumber=At._getBaseCellNumber,n._getDirectedEdgeDestination=At._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=At._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=At._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=At._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=At._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=At._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=At._getIcosahedronFaces,n._getNumCells=At._getNumCells,n._getPentagons=At._getPentagons,n._getRes0Cells=At._getRes0Cells,n._getResolution=At._getResolution,n._greatCircleDistanceKm=At._greatCircleDistanceKm,n._greatCircleDistanceM=At._greatCircleDistanceM,n._greatCircleDistanceRads=At._greatCircleDistanceRads,n._gridDisk=At._gridDisk,n._gridDiskDistances=At._gridDiskDistances,n._gridDistance=At._gridDistance,n._gridPathCells=At._gridPathCells,n._gridPathCellsSize=At._gridPathCellsSize,n._gridRingUnsafe=At._gridRingUnsafe,n._i64Add=At._i64Add,n._i64Subtract=At._i64Subtract,n._isPentagon=At._isPentagon,n._isResClassIII=At._isResClassIII,n._isValidCell=At._isValidCell,n._isValidDirectedEdge=At._isValidDirectedEdge,n._isValidVertex=At._isValidVertex,n._latLngToCell=At._latLngToCell,n._llvm_maxnum_f64=At._llvm_maxnum_f64,n._llvm_minnum_f64=At._llvm_minnum_f64,n._llvm_round_f64=At._llvm_round_f64,n._localIjToCell=At._localIjToCell,n._malloc=At._malloc,n._maxFaceCount=At._maxFaceCount,n._maxGridDiskSize=At._maxGridDiskSize,n._maxPolygonToCellsSize=At._maxPolygonToCellsSize,n._memcpy=At._memcpy,n._memset=At._memset,n._originToDirectedEdges=At._originToDirectedEdges,n._pentagonCount=At._pentagonCount,n._polygonToCells=At._polygonToCells,n._readInt64AsDoubleFromPointer=At._readInt64AsDoubleFromPointer,n._res0CellCount=At._res0CellCount,n._round=At._round,n._sbrk=At._sbrk,n._sizeOfCellBoundary=At._sizeOfCellBoundary,n._sizeOfCoordIJ=At._sizeOfCoordIJ,n._sizeOfGeoLoop=At._sizeOfGeoLoop,n._sizeOfGeoPolygon=At._sizeOfGeoPolygon,n._sizeOfH3Index=At._sizeOfH3Index,n._sizeOfLatLng=At._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=At._sizeOfLinkedGeoPolygon,n._uncompactCells=At._uncompactCells,n._uncompactCellsSize=At._uncompactCellsSize,n._vertexToLatLng=At._vertexToLatLng,n.establishStackSpace=At.establishStackSpace;var ot,st,at=n.stackAlloc=At.stackAlloc,ut=n.stackRestore=At.stackRestore,ct=n.stackSave=At.stackSave;if(n.asm=At,n.cwrap=function(t,e,n,r){var A=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&A&&!r?v(t):function(){return E(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":b[t|0]=e;break;case"i16":C[t>>1]=e;break;case"i32":x[t>>2]=e;break;case"i64":j=[e>>>0,(Y=e,+G(Y)>=1?Y>0?(0|z(+Q(Y/4294967296),4294967295))>>>0:~~+U((Y-+(~~Y>>>0))/4294967296)>>>0:0)],x[t>>2]=j[0],x[t+4>>2]=j[1];break;case"float":N[t>>2]=e;break;case"double":S[t>>3]=e;break;default:yt("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 b[t|0];case"i16":return C[t>>1];case"i32":case"i64":return x[t>>2];case"float":return N[t>>2];case"double":return S[t>>3];default:yt("invalid type for getValue: "+e)}return null},H)if($(H)||(ot=H,H=n.locateFile?n.locateFile(ot,p):p+ot),a||s){var lt=l(H);I.set(lt,8)}else{V++,n.monitorRunDependencies&&n.monitorRunDependencies(V);var ft=function(t){t.byteLength&&(t=new Uint8Array(t)),I.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(V--,n.monitorRunDependencies&&n.monitorRunDependencies(V),0==V&&q){var t=q;q=null,t()}}()},ht=function(){c(H,ft,(function(){throw"could not load memory initializer "+H}))},pt=rt(H);if(pt)ft(pt.buffer);else if(n.memoryInitializerRequest){var dt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=rt(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+H),void ht();e=r.buffer}ft(e)};n.memoryInitializerRequest.response?setTimeout(dt,0):n.memoryInitializerRequest.addEventListener("load",dt)}else ht()}function gt(t){function e(){st||(st=!0,_||(R(k),R(B),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),F.unshift(t);var t;R(F)}()))}V>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),P.unshift(t);var t;R(P)}(),V>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function yt(t){throw n.onAbort&&n.onAbort(t),d(t+=""),g(t),_=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(q=function t(){st||gt(),st||(q=t)},n.run=gt,n.abort=yt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return gt(),t}("object"==typeof yA?yA:{}),_A="number",mA=[["sizeOfH3Index",_A],["sizeOfLatLng",_A],["sizeOfCellBoundary",_A],["sizeOfGeoLoop",_A],["sizeOfGeoPolygon",_A],["sizeOfLinkedGeoPolygon",_A],["sizeOfCoordIJ",_A],["readInt64AsDoubleFromPointer",_A],["isValidCell",_A,[_A,_A]],["latLngToCell",_A,[_A,_A,_A,_A]],["cellToLatLng",_A,[_A,_A,_A]],["cellToBoundary",_A,[_A,_A,_A]],["maxGridDiskSize",_A,[_A,_A]],["gridDisk",_A,[_A,_A,_A,_A]],["gridDiskDistances",_A,[_A,_A,_A,_A,_A]],["gridRingUnsafe",_A,[_A,_A,_A,_A]],["maxPolygonToCellsSize",_A,[_A,_A,_A,_A]],["polygonToCells",_A,[_A,_A,_A,_A]],["cellsToLinkedMultiPolygon",_A,[_A,_A,_A]],["destroyLinkedMultiPolygon",null,[_A]],["compactCells",_A,[_A,_A,_A,_A]],["uncompactCells",_A,[_A,_A,_A,_A,_A,_A]],["uncompactCellsSize",_A,[_A,_A,_A,_A,_A]],["isPentagon",_A,[_A,_A]],["isResClassIII",_A,[_A,_A]],["getBaseCellNumber",_A,[_A,_A]],["getResolution",_A,[_A,_A]],["maxFaceCount",_A,[_A,_A,_A]],["getIcosahedronFaces",_A,[_A,_A,_A]],["cellToParent",_A,[_A,_A,_A,_A]],["cellToChildren",_A,[_A,_A,_A,_A]],["cellToCenterChild",_A,[_A,_A,_A,_A]],["cellToChildrenSize",_A,[_A,_A,_A,_A]],["cellToChildPos",_A,[_A,_A,_A,_A]],["childPosToCell",_A,[_A,_A,_A,_A,_A,_A]],["areNeighborCells",_A,[_A,_A,_A,_A,_A]],["cellsToDirectedEdge",_A,[_A,_A,_A,_A,_A]],["getDirectedEdgeOrigin",_A,[_A,_A,_A]],["getDirectedEdgeDestination",_A,[_A,_A,_A]],["isValidDirectedEdge",_A,[_A,_A]],["directedEdgeToCells",_A,[_A,_A,_A]],["originToDirectedEdges",_A,[_A,_A,_A]],["directedEdgeToBoundary",_A,[_A,_A,_A]],["gridDistance",_A,[_A,_A,_A,_A,_A]],["gridPathCells",_A,[_A,_A,_A,_A,_A]],["gridPathCellsSize",_A,[_A,_A,_A,_A,_A]],["cellToLocalIj",_A,[_A,_A,_A,_A,_A,_A]],["localIjToCell",_A,[_A,_A,_A,_A,_A]],["getHexagonAreaAvgM2",_A,[_A,_A]],["getHexagonAreaAvgKm2",_A,[_A,_A]],["getHexagonEdgeLengthAvgM",_A,[_A,_A]],["getHexagonEdgeLengthAvgKm",_A,[_A,_A]],["greatCircleDistanceM",_A,[_A,_A]],["greatCircleDistanceKm",_A,[_A,_A]],["greatCircleDistanceRads",_A,[_A,_A]],["cellAreaM2",_A,[_A,_A,_A]],["cellAreaKm2",_A,[_A,_A,_A]],["cellAreaRads2",_A,[_A,_A,_A]],["edgeLengthM",_A,[_A,_A,_A]],["edgeLengthKm",_A,[_A,_A,_A]],["edgeLengthRads",_A,[_A,_A,_A]],["getNumCells",_A,[_A,_A]],["getRes0Cells",_A,[_A]],["res0CellCount",_A],["getPentagons",_A,[_A,_A]],["pentagonCount",_A],["cellToVertex",_A,[_A,_A,_A,_A]],["cellToVertexes",_A,[_A,_A,_A]],["vertexToLatLng",_A,[_A,_A,_A]],["isValidVertex",_A,[_A,_A]]],vA=4,EA={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"};EA[vA]="Resolution argument was outside of acceptable range",EA[5]="Cell argument was not valid",EA[6]="Directed edge argument was not valid",EA[7]="Undirected edge argument was not valid",EA[8]="Vertex argument was not valid",EA[9]="Pentagon distortion was encountered",EA[10]="Duplicate input",EA[11]="Cell arguments were not neighbors",EA[12]="Cell arguments had incompatible resolutions",EA[13]="Memory allocation failed",EA[14]="Bounds of provided memory were insufficient",EA[15]="Mode or flags argument was not valid";var wA=1001,bA=1002,IA={1e3:"Unknown unit"};IA[wA]="Array length out of bounds",IA[bA]="Got unexpected null value for H3 index";var CA="Unknown error";function xA(t,e,n){var r=n&&"value"in n,A=new Error((t[e]||CA)+" (code: "+e+(r?", value: "+n.value:"")+")");return A.code=e,A}function NA(t,e){return xA(EA,t,2===arguments.length?{value:e}:{})}function SA(t,e){return xA(IA,t,2===arguments.length?{value:e}:{})}function DA(t){if(0!==t)throw NA(t)}var LA={};mA.forEach((function(t){LA[t[0]]=yA.cwrap.apply(yA,t)}));var TA=16,MA=4,OA=8,RA=LA.sizeOfH3Index(),PA=LA.sizeOfLatLng(),kA=LA.sizeOfCellBoundary(),BA=LA.sizeOfGeoPolygon(),FA=LA.sizeOfGeoLoop();function GA(t){if(!t)throw SA(bA);return t}LA.sizeOfLinkedGeoPolygon(),LA.sizeOfCoordIJ();var UA=Math.pow(2,32)-1;var QA=/[^0-9a-fA-F]/;function zA(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||QA.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),TA);return[parseInt(t.substring(t.length-8),TA),e]}function VA(t){if(t>=0)return t.toString(TA);var e=qA(8,(t&=2147483647).toString(TA));return e=(parseInt(e[0],TA)+8).toString(TA)+e.substring(1)}function qA(t,e){for(var n=t-e.length,r="",A=0;A<n;A++)r+="0";return r+=e}var YA=Math.pow(2,32);function jA(t,e,n){for(var r=t.length,A=yA._calloc(r,PA),i=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)yA.HEAPF64.set([t[s/2][i],t[s/2][o]].map(ti),A/OA+s);return yA.HEAPU32.set([r,A],e/MA),e}function HA(t,e){void 0===e&&(e=0);var n=yA.getValue(t+RA*e,"i32"),r=yA.getValue(t+RA*e+MA,"i32");return r?function(t,e){return VA(e)+qA(8,VA(t))}(n,r):null}function XA(t){return function(t){return 180*t/Math.PI}(yA.getValue(t,"double"))}function $A(t){return[XA(t+OA),XA(t)]}function WA(t,e){var n=yA._malloc(kA),r=zA(t),A=r[0],i=r[1];try{return DA(LA.cellToBoundary(A,i,n)),function(t){for(var e=yA.getValue(t,"i32"),n=t+OA,r=[],A=$A,i=0;i<2*e;i+=2)r.push(A(n+OA*i));return r.push(r[0]),r}(n)}finally{yA._free(n)}}function KA(t,e){var n=zA(t),r=n[0],A=n[1],i=yA._malloc(RA);try{return DA(LA.cellToParent(r,A,e,i)),GA(HA(i))}finally{yA._free(i)}}function ZA(t,e,n){var r,A="number"!=typeof(r=t)?[0,0]:[0|r,r/YA|0],i=A[0],o=A[1],s=zA(e),a=s[0],u=s[1],c=yA._malloc(RA);try{return DA(LA.childPosToCell(i,o,a,u,n,c)),GA(HA(c))}finally{yA._free(c)}}function JA(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw NA(vA,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,A=function(t,e){var n,r=t.length-1,A=yA._calloc(BA),i=0+FA,o=i+MA;if(jA(t[0],A+0,e),r>0){n=yA._calloc(r,FA);for(var s=0;s<r;s++)jA(t[s+1],n+FA*s,e)}return yA.setValue(A+i,r,"i32"),yA.setValue(A+o,n,"i32"),A}("number"==typeof t[0][0]?[t]:t,n),i=yA._malloc(8);try{DA(LA.maxPolygonToCellsSize(A,e,0,i));var o=function(t){if(t>UA)throw SA(wA,t);return t}((r=i,LA.readInt64AsDoubleFromPointer(r))),s=yA._calloc(o,RA);try{return DA(LA.polygonToCells(A,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var A=HA(t,r);null!==A&&n.push(A)}return n}(s,o)}finally{yA._free(s)}}finally{yA._free(i),function(t){var e=0+FA,n=e+MA,r=MA;yA._free(yA.getValue(t+0+r,"i8*"));var A=yA.getValue(t+e,"i32");if(A>0){for(var i=yA.getValue(t+n,"i32"),o=0;o<A;o++)yA._free(yA.getValue(i+FA*o+r,"i8*"));yA._free(i)}yA._free(t)}(A)}}function ti(t){return t*Math.PI/180}const ei=({icao:t,mapping:e})=>{if(!t)throw new sA("Missing ICAO code.");if(!e)throw new sA("Missing aircraft mapping.");const n=e.find((e=>e.icao.toUpperCase()===t.toUpperCase()))?.group;if(!n)throw new sA(`Aircraft type not found for ICAO: ${t}`);return n},ni=t=>void 0===t,ri=t=>"function"==typeof t,Ai=t=>"object"==typeof t,ii=t=>{let e;const n=()=>{clearTimeout(e),e=null};return{run:r=>{n(),e=setTimeout(r,t)},cancel:n}},oi=(t,e)=>{if(ni(e))return!1;const n=Ai(e),r=Array.isArray(e);return n&&!r?Object.keys(e).some((n=>oi(t?.[n],e[n]))):r?e.some(((e,n)=>oi(t?.[n],e))):t!==e},si=({current:t,next:e})=>Object.keys(e).reduce(((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t)),{...t}),ai=({current:t,next:e})=>{const n=new Set,r=!ni(t)&&Ai(t);if(!(!ni(e)&&Ai(e)))return n;const A=Object.keys(e);return r?(A.forEach((r=>{oi(t[r],e[r])&&n.add(r)})),n):(A.forEach((t=>n.add(t))),n)};var ui=Object.freeze({__proto__:null,buildDataKeyFromComponents:({components:t,separator:e="-"})=>t.join(e),debounce:(t,e)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>t(...r)),e)}},getChangedFields:ai,getTimer:ii,isChanged:oi,isFunction:ri,isObject:Ai,isUndefined:ni,mapAircraftIcaoToAircraftType:ei,mergeByProperty:(t,e,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:si,parseDataKeyToComponents:({dataKey:t,separator:e="-"})=>t.split(e),throttle:(t,e)=>{let n=0;return(...r)=>{const A=(new Date).getTime();A-n<e||(n=A,t(...r))}}}),ci=6371008.8,li={centimeters:100*ci,centimetres:100*ci,degrees:ci/111325,feet:3.28084*ci,inches:39.37*ci,kilometers:ci/1e3,kilometres:ci/1e3,meters:ci,metres:ci,miles:ci/1609.344,millimeters:1e3*ci,millimetres:1e3*ci,nauticalmiles:ci/1852,radians:1,yards:1.0936*ci};function fi(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 hi(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(!vi(t[0])||!vi(t[1]))throw new Error("coordinates must contain numbers");return fi({type:"Point",coordinates:t},e,n)}function pi(t,e,n){void 0===n&&(n={});for(var r=0,A=t;r<A.length;r++){var i=A[r];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return fi({type:"Polygon",coordinates:t},e,n)}function di(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 gi(t,e){void 0===e&&(e="kilometers");var n=li[e];if(!n)throw new Error(e+" units is invalid");return t*n}function yi(t,e){void 0===e&&(e="kilometers");var n=li[e];if(!n)throw new Error(e+" units is invalid");return t/n}function _i(t){return t%360*Math.PI/180}function mi(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 gi(yi(t,e),n)}function vi(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function Ei(t,e,n){if(null!==t)for(var r,A,i,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 E=o.type;switch(l=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){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"===E&&m++}"LineString"===E&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<a.length;r++){for(A=0;A<a[r].length-l;A++){if(!1===e(a[r][A],f,y,m,v))return!1;f++}"MultiLineString"===E&&m++,"Polygon"===E&&v++}"Polygon"===E&&m++;break;case"MultiPolygon":for(r=0;r<a.length;r++){for(v=0,A=0;A<a[r].length;A++){for(i=0;i<a[r][A].length-l;i++){if(!1===e(a[r][A][i],f,y,m,v))return!1;f++}v++}m++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===Ei(o.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function wi(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 bi(t,e){var n,r,A,i,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,A=0;A<o;A++)if(null!==(i=a?s.geometries[A]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,f,u,c,l))return!1;break;case"GeometryCollection":for(r=0;r<i.geometries.length;r++)if(!1===e(i.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 Ii(t){var e=[1/0,1/0,-1/0,-1/0];return Ei(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 Ci(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 xi(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Ni(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 Ni(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Di(t);default:throw new Error("unknown GeoJSON type")}}function Ni(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=Si(t.properties),e.geometry=Di(t.geometry),e}function Si(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]=Si(r):e[n]=r})),e):e}function Di(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Di(t)})),e):(e.coordinates=Li(t.coordinates),e)}function Li(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Li(t)}))}function Ti(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),A=Number(t[2]),i=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 pi([[o,[A,r],[A,i],[n,i],o]],e.properties,{bbox:t,id:e.id})}function Mi(t,e){void 0===e&&(e={});var n=Ii(t);return hi([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}function Oi(t,e,n){void 0===n&&(n={});var r=Ci(t),A=Ci(e);A[0]+=A[0]-r[0]>180?-360:r[0]-A[0]>180?360:0;var i=function(t,e,n){var r=n=void 0===n?ci:Number(n),A=t[1]*Math.PI/180,i=e[1]*Math.PI/180,o=i-A,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var a=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(A/2+Math.PI/4)),u=Math.abs(a)>1e-11?o/a:Math.cos(A);return Math.sqrt(o*o+u*u*s*s)*r}(r,A);return mi(i,"meters",n.units)}Ii.default=Ii;var Ri=6378137;function Pi(t){return function(t,e,n){var r=n;return bi(t,(function(t,A,i,o,s){r=0===A&&void 0===n?t:e(r,t,A,i,o,s)})),r}(t,(function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return ki(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=ki(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}function ki(t){var e=0;if(t&&t.length>0){e+=Math.abs(Bi(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Bi(t[n]))}return e}function Bi(t){var e,n,r,A,i,o,s=0,a=t.length;if(a>2){for(o=0;o<a;o++)o===a-2?(r=a-2,A=a-1,i=0):o===a-1?(r=a-1,A=0,i=1):(r=o,A=o+1,i=o+2),e=t[r],n=t[A],s+=(Fi(t[i][0])-Fi(e[0]))*Math.sin(Fi(n[1]));s=s*Ri*Ri/2}return s}function Fi(t){return t*Math.PI/180}function Gi(t,e){var n=_i(t[1]),r=_i(e[1]),A=_i(e[0]-t[0]);A>Math.PI&&(A-=2*Math.PI),A<-Math.PI&&(A+=2*Math.PI);var i=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(A,i))+360)%360}function Ui(t,e,n,r){void 0===r&&(r={});var A=e<0,i=mi(Math.abs(e),r.units,"meters");A&&(i=-Math.abs(i));var o=Ci(t),s=function(t,e,n,r){r=void 0===r?ci:Number(r);var A=e/r,i=t[0]*Math.PI/180,o=_i(t[1]),s=_i(n),a=A*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=A*Math.sin(s)/l;return[(180*(i+f)/Math.PI+540)%360-180,180*u/Math.PI]}(o,i,n);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,hi(s,r.properties)}function Qi(t,e,n){if(!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,A=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(A)||"object"==typeof A;return!0!==i&&(t=xi(t)),"FeatureCollection"!==t.type||o?zi(t,e,A):(wi(t,(function(n,r){t.features[r]=zi(n,e,A)})),t)}function zi(t,e,n){var r,A="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 Ci(e);var n=t.bbox?t.bbox:Ii(t),r=n[0],A=n[1],i=n[2],o=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return hi([r,A]);case"se":case"southeast":case"eastsouth":case"bottomright":return hi([i,A]);case"nw":case"northwest":case"westnorth":case"topleft":return hi([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return hi([i,o]);case"center":return Mi(t);case void 0:case null:case"centroid":return function(t,e){void 0===e&&(e={});var n=0,r=0,A=0;return Ei(t,(function(t){n+=t[0],r+=t[1],A++}),!0),hi([n/A,r/A],e.properties)}(t);default:throw new Error("invalid origin")}}(t,n),1===e||A||Ei(t,(function(t){var r,A,i,o,s=Oi(n,t),a=(r=n,A=t,void 0===i&&(i={}),(o=i.final?Gi(Ci(A),Ci(r)):Gi(Ci(r),Ci(A)))>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")}(Ui(n,s*e,a));t[0]=u[0],t[1]=u[1],3===t.length&&(t[2]*=e)})),t}"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 A=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(A=A<0?Math.max(n+arguments[2],0):Math.min(A,n);r<A;)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 Vi=function(){};Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi},Vi.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var qi=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),Yi=function(){},ji={MAX_VALUE:{configurable:!0}};Yi.isNaN=function(t){return Number.isNaN(t)},Yi.doubleToLongBits=function(t){return t},Yi.longBitsToDouble=function(t){return t},Yi.isInfinite=function(t){return!Number.isFinite(t)},ji.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Yi,ji);var Hi=function(){},Xi=function(){},$i=function(){};function Wi(){}var Ki=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])},Zi={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};Ki.prototype.setOrdinate=function(t,e){switch(t){case Ki.X:this.x=e;break;case Ki.Y:this.y=e;break;case Ki.Z:this.z=e;break;default:throw new qi("Invalid ordinate index: "+t)}},Ki.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!!Vi.equalsWithTolerance(this.x,e.x,n)&&!!Vi.equalsWithTolerance(this.y,e.y,n)}},Ki.prototype.getOrdinate=function(t){switch(t){case Ki.X:return this.x;case Ki.Y:return this.y;case Ki.Z:return this.z}throw new qi("Invalid ordinate index: "+t)},Ki.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Yi.isNaN(this.z))&&Yi.isNaN(t.z)},Ki.prototype.equals=function(t){return t instanceof Ki&&this.equals2D(t)},Ki.prototype.equalInZ=function(t,e){return Vi.equalsWithTolerance(this.z,t.z,e)},Ki.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},Ki.prototype.clone=function(){},Ki.prototype.copy=function(){return new Ki(this)},Ki.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Ki.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)},Ki.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},Ki.prototype.hashCode=function(){var t=17;return t=37*(t=37*t+Ki.hashCode(this.x))+Ki.hashCode(this.y)},Ki.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},Ki.prototype.interfaces_=function(){return[Hi,Xi,Wi]},Ki.prototype.getClass=function(){return Ki},Ki.hashCode=function(){if(1===arguments.length){Yi.doubleToLongBits(arguments[0]);return Math.trunc(0)}},Zi.DimensionalComparator.get=function(){return Ji},Zi.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Zi.NULL_ORDINATE.get=function(){return Yi.NaN},Zi.X.get=function(){return 0},Zi.Y.get=function(){return 1},Zi.Z.get=function(){return 2},Object.defineProperties(Ki,Zi);var Ji=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 qi("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Ji.prototype.compare=function(t,e){var n=t,r=e,A=Ji.compare(n.x,r.x);if(0!==A)return A;var i=Ji.compare(n.y,r.y);return 0!==i?i:this._dimensionsToTest<=2?0:Ji.compare(n.z,r.z)},Ji.prototype.interfaces_=function(){return[$i]},Ji.prototype.getClass=function(){return Ji},Ji.compare=function(t,e){return t<e?-1:t>e?1:Yi.isNaN(t)?Yi.isNaN(e)?0:-1:Yi.isNaN(e)?1:0};var to=function(){};to.prototype.create=function(){},to.prototype.interfaces_=function(){return[]},to.prototype.getClass=function(){return to};var eo=function(){},no={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};eo.prototype.interfaces_=function(){return[]},eo.prototype.getClass=function(){return eo},eo.toLocationSymbol=function(t){switch(t){case eo.EXTERIOR:return"e";case eo.BOUNDARY:return"b";case eo.INTERIOR:return"i";case eo.NONE:return"-"}throw new qi("Unknown location value: "+t)},no.INTERIOR.get=function(){return 0},no.BOUNDARY.get=function(){return 1},no.EXTERIOR.get=function(){return 2},no.NONE.get=function(){return-1},Object.defineProperties(eo,no);var ro=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Ao=function(){},io={LOG_10:{configurable:!0}};Ao.prototype.interfaces_=function(){return[]},Ao.prototype.getClass=function(){return Ao},Ao.log10=function(t){var e=Math.log(t);return Yi.isInfinite(e)||Yi.isNaN(e)?e:e/Ao.LOG_10},Ao.min=function(t,e,n,r){var A=t;return e<A&&(A=e),n<A&&(A=n),r<A&&(A=r),A},Ao.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],A=arguments[1],i=arguments[2];return r<A?A:r>i?i:r}},Ao.wrap=function(t,e){return t<0?e- -t%e:t%e},Ao.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],A=arguments[2],i=arguments[3],o=arguments[0];return r>o&&(o=r),A>o&&(o=A),i>o&&(o=i),o}},Ao.average=function(t,e){return(t+e)/2},io.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ao,io);var oo=function(t){this.str=t};oo.prototype.append=function(t){this.str+=t},oo.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},oo.prototype.toString=function(t){return this.str};var so=function(t){this.value=t};so.prototype.intValue=function(){return this.value},so.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},so.isNaN=function(t){return Number.isNaN(t)};var ao=function(){};ao.isWhitespace=function(t){return t<=32&&t>=0||127===t},ao.toUpperCase=function(t){return t.toUpperCase()};var uo=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 if("string"==typeof arguments[0]){t.call(this,t.parse(arguments[0]))}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.init(r,A)}},co={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}};uo.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},uo.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=uo.magnitude(n._hi),A=uo.TEN.pow(r);(n=n.divide(A)).gt(uo.TEN)?(n=n.divide(uo.TEN),r+=1):n.lt(uo.ONE)&&(n=n.multiply(uo.TEN),r-=1);for(var i=r+1,o=new oo,s=uo.MAX_PRINT_DIGITS-1,a=0;a<=s;a++){t&&a===i&&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(uo.valueOf(u)).multiply(uo.TEN),c&&n.selfAdd(uo.TEN);var f=!0,h=uo.magnitude(n._hi);if(h<0&&Math.abs(h)>=s-a&&(f=!1),!f)break}return e[0]=r,o.toString()},uo.prototype.sqr=function(){return this.multiply(this)},uo.prototype.doubleValue=function(){return this._hi+this._lo},uo.prototype.subtract=function(){if(arguments[0]instanceof uo){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},uo.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},uo.prototype.isZero=function(){return 0===this._hi&&0===this._lo},uo.prototype.selfSubtract=function(){if(arguments[0]instanceof uo){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)}},uo.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},uo.prototype.min=function(t){return this.le(t)?this:t},uo.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof uo){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,r,A,i,o=arguments[0],s=arguments[1],a=null,u=null,c=null,l=null;return A=this._hi/o,l=(a=(c=uo.SPLIT*A)-(a=c-A))*(u=(l=uo.SPLIT*o)-(u=l-o))-(i=A*o)+a*(r=o-u)+(n=A-a)*u+n*r,l=A+(c=(this._hi-i-l+this._lo-A*s)/o),this._hi=l,this._lo=A-l+c,this}},uo.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},uo.prototype.divide=function(){if(arguments[0]instanceof uo){var t,e,n,r,A=arguments[0],i=null,o=null,s=null,a=null;return t=(n=this._hi/A._hi)-(i=(s=uo.SPLIT*n)-(i=s-n)),a=i*(o=(a=uo.SPLIT*A._hi)-(o=a-A._hi))-(r=n*A._hi)+i*(e=A._hi-o)+t*o+t*e,s=(this._hi-r-a+this._lo-n*A._lo)/A._hi,new uo(a=n+s,n-a+s)}if("number"==typeof arguments[0]){var u=arguments[0];return Yi.isNaN(u)?uo.createNaN():uo.copy(this).selfDivide(u,0)}},uo.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},uo.prototype.pow=function(t){if(0===t)return uo.valueOf(1);var e=new uo(this),n=uo.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},uo.prototype.ceil=function(){if(this.isNaN())return uo.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new uo(t,e)},uo.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},uo.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},uo.prototype.setValue=function(){if(arguments[0]instanceof uo){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},uo.prototype.max=function(t){return this.ge(t)?this:t},uo.prototype.sqrt=function(){if(this.isZero())return uo.valueOf(0);if(this.isNegative())return uo.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=uo.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},uo.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof uo){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,n,r,A,i,o=arguments[0],s=null;return s=(r=this._hi+o)-(A=r-this._hi),n=(i=(s=o-A+(this._hi-s))+this._lo)+(r-(e=r+i)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var a,u,c,l,f=arguments[0],h=arguments[1],p=null,d=null,g=null;c=this._hi+f,u=this._lo+h,d=c-(g=c-this._hi),p=u-(l=u-this._lo);var y=(a=c+(g=(d=f-g+(this._hi-d))+u))+(g=(p=h-l+(this._lo-p))+(g+(c-a))),_=g+(a-y);return this._hi=y,this._lo=_,this}},uo.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof uo){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,r,A=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null;o=(a=uo.SPLIT*this._hi)-this._hi,u=uo.SPLIT*A,o=a-o,n=this._hi-o,s=u-A;var c=(a=this._hi*A)+(u=o*(s=u-s)-a+o*(r=A-s)+n*s+n*r+(this._hi*i+this._lo*A)),l=u+(o=a-c);return this._hi=c,this._lo=l,this}},uo.prototype.selfSqr=function(){return this.selfMultiply(this)},uo.prototype.floor=function(){if(this.isNaN())return uo.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new uo(t,e)},uo.prototype.negate=function(){return this.isNaN()?this:new uo(-this._hi,-this._lo)},uo.prototype.clone=function(){},uo.prototype.multiply=function(){if(arguments[0]instanceof uo){var t=arguments[0];return t.isNaN()?uo.createNaN():uo.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Yi.isNaN(e)?uo.createNaN():uo.copy(this).selfMultiply(e,0)}},uo.prototype.isNaN=function(){return Yi.isNaN(this._hi)},uo.prototype.intValue=function(){return Math.trunc(this._hi)},uo.prototype.toString=function(){var t=uo.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},uo.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,A=n;if("."===n.charAt(0))A="0"+n;else if(r<0)A="0."+uo.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var i=r-n.length;A=n+uo.stringOfChar("0",i)+".0"}return this.isNegative()?"-"+A:A},uo.prototype.reciprocal=function(){var t,e,n,r,A=null,i=null,o=null,s=null;t=(n=1/this._hi)-(A=(o=uo.SPLIT*n)-(A=o-n)),i=(s=uo.SPLIT*this._hi)-this._hi;var a=n+(o=(1-(r=n*this._hi)-(s=A*(i=s-i)-r+A*(e=this._hi-i)+t*i+t*e)-n*this._lo)/this._hi);return new uo(a,n-a+o)},uo.prototype.toSciNotation=function(){if(this.isZero())return uo.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=uo.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var A="";n.length>1&&(A=n.substring(1));var i=n.charAt(0)+"."+A;return this.isNegative()?"-"+i+r:i+r},uo.prototype.abs=function(){return this.isNaN()?uo.NaN:this.isNegative()?this.negate():new uo(this)},uo.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},uo.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},uo.prototype.add=function(){if(arguments[0]instanceof uo){var t=arguments[0];return uo.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return uo.copy(this).selfAdd(e)}},uo.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 uo){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}},uo.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},uo.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},uo.prototype.trunc=function(){return this.isNaN()?uo.NaN:this.isPositive()?this.floor():this.ceil()},uo.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},uo.prototype.interfaces_=function(){return[Wi,Hi,Xi]},uo.prototype.getClass=function(){return uo},uo.sqr=function(t){return uo.valueOf(t).selfMultiply(t)},uo.valueOf=function(){return"string"==typeof arguments[0]?uo.parse(arguments[0]):"number"==typeof arguments[0]?new uo(arguments[0]):void 0},uo.sqrt=function(t){return uo.valueOf(t).sqrt()},uo.parse=function(t){for(var e=0,n=t.length;ao.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var A=t.charAt(e);"-"!==A&&"+"!==A||(e++,"-"===A&&(r=!0))}for(var i=new uo,o=0,s=0,a=0;!(e>=n);){var u=t.charAt(e);if(e++,ao.isDigit(u)){var c=u-"0";i.selfMultiply(uo.TEN),i.selfAdd(c),o++}else{if("."!==u){if("e"===u||"E"===u){var l=t.substring(e);try{a=so.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=i,h=o-s-a;if(0===h)f=i;else if(h>0){var p=uo.TEN.pow(h);f=i.divide(p)}else if(h<0){var d=uo.TEN.pow(-h);f=i.multiply(d)}return r?f.negate():f},uo.createNaN=function(){return new uo(Yi.NaN,Yi.NaN)},uo.copy=function(t){return new uo(t)},uo.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},uo.stringOfChar=function(t,e){for(var n=new oo,r=0;r<e;r++)n.append(t);return n.toString()},co.PI.get=function(){return new uo(3.141592653589793,12246467991473532e-32)},co.TWO_PI.get=function(){return new uo(6.283185307179586,24492935982947064e-32)},co.PI_2.get=function(){return new uo(1.5707963267948966,6123233995736766e-32)},co.E.get=function(){return new uo(2.718281828459045,14456468917292502e-32)},co.NaN.get=function(){return new uo(Yi.NaN,Yi.NaN)},co.EPS.get=function(){return 123259516440783e-46},co.SPLIT.get=function(){return 134217729},co.MAX_PRINT_DIGITS.get=function(){return 32},co.TEN.get=function(){return uo.valueOf(10)},co.ONE.get=function(){return uo.valueOf(1)},co.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},co.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(uo,co);var lo=function(){},fo={DP_SAFE_EPSILON:{configurable:!0}};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.orientationIndex=function(t,e,n){var r=lo.orientationIndexFilter(t,e,n);if(r<=1)return r;var A=uo.valueOf(e.x).selfAdd(-t.x),i=uo.valueOf(e.y).selfAdd(-t.y),o=uo.valueOf(n.x).selfAdd(-e.x),s=uo.valueOf(n.y).selfAdd(-e.y);return A.selfMultiply(s).selfSubtract(i.selfMultiply(o)).signum()},lo.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},lo.intersection=function(t,e,n,r){var A=uo.valueOf(r.y).selfSubtract(n.y).selfMultiply(uo.valueOf(e.x).selfSubtract(t.x)),i=uo.valueOf(r.x).selfSubtract(n.x).selfMultiply(uo.valueOf(e.y).selfSubtract(t.y)),o=A.subtract(i),s=uo.valueOf(r.x).selfSubtract(n.x).selfMultiply(uo.valueOf(t.y).selfSubtract(n.y)),a=uo.valueOf(r.y).selfSubtract(n.y).selfMultiply(uo.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(a).selfDivide(o).doubleValue(),c=uo.valueOf(t.x).selfAdd(uo.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),l=uo.valueOf(e.x).selfSubtract(t.x).selfMultiply(uo.valueOf(t.y).selfSubtract(n.y)),f=uo.valueOf(e.y).selfSubtract(t.y).selfMultiply(uo.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(f).selfDivide(o).doubleValue(),p=uo.valueOf(n.y).selfAdd(uo.valueOf(r.y).selfSubtract(n.y).selfMultiply(h)).doubleValue();return new Ki(c,p)},lo.orientationIndexFilter=function(t,e,n){var r=null,A=(t.x-n.x)*(e.y-n.y),i=(t.y-n.y)*(e.x-n.x),o=A-i;if(A>0){if(i<=0)return lo.signum(o);r=A+i}else{if(!(A<0))return lo.signum(o);if(i>=0)return lo.signum(o);r=-A-i}var s=lo.DP_SAFE_EPSILON*r;return o>=s||-o>=s?lo.signum(o):2},lo.signum=function(t){return t>0?1:t<0?-1:0},fo.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(lo,fo);var ho=function(){},po={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};po.X.get=function(){return 0},po.Y.get=function(){return 1},po.Z.get=function(){return 2},po.M.get=function(){return 3},ho.prototype.setOrdinate=function(t,e,n){},ho.prototype.size=function(){},ho.prototype.getOrdinate=function(t,e){},ho.prototype.getCoordinate=function(){},ho.prototype.getCoordinateCopy=function(t){},ho.prototype.getDimension=function(){},ho.prototype.getX=function(t){},ho.prototype.clone=function(){},ho.prototype.expandEnvelope=function(t){},ho.prototype.copy=function(){},ho.prototype.getY=function(t){},ho.prototype.toCoordinateArray=function(){},ho.prototype.interfaces_=function(){return[Xi]},ho.prototype.getClass=function(){return ho},Object.defineProperties(ho,po);var go=function(){},yo=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}(go),_o=function(){};_o.arraycopy=function(t,e,n,r,A){for(var i=0,o=e;o<e+A;o++)n[r+i]=t[o],i++},_o.getProperty=function(t){return{"line.separator":"\n"}[t]};var mo=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 A=arguments[0],i=arguments[1];this.x=A.y*i.w-i.y*A.w,this.y=i.x*A.w-A.x*i.w,this.w=A.x*i.y-i.x*A.y}else if(arguments[0]instanceof Ki&&arguments[1]instanceof Ki){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}};mo.prototype.getY=function(){var t=this.y/this.w;if(Yi.isNaN(t)||Yi.isInfinite(t))throw new yo;return t},mo.prototype.getX=function(){var t=this.x/this.w;if(Yi.isNaN(t)||Yi.isInfinite(t))throw new yo;return t},mo.prototype.getCoordinate=function(){var t=new Ki;return t.x=this.getX(),t.y=this.getY(),t},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},mo.intersection=function(t,e,n,r){var A=t.y-e.y,i=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=A*a-s*i,l=(i*u-a*o)/c,f=(s*o-A*u)/c;if(Yi.isNaN(l)||Yi.isInfinite(l)||Yi.isNaN(f)||Yi.isInfinite(f))throw new yo;return new Ki(l,f)};var vo=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 Ki){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],A=arguments[1];this.init(r.x,A.x,r.y,A.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(i,o,s,a)}},Eo={serialVersionUID:{configurable:!0}};vo.prototype.getArea=function(){return this.getWidth()*this.getHeight()},vo.prototype.equals=function(t){if(!(t instanceof vo))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()},vo.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new vo;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,A=this._maxy<t._maxy?this._maxy:t._maxy;return new vo(e,r,n,A)},vo.prototype.isNull=function(){return this._maxx<this._minx},vo.prototype.getMaxX=function(){return this._maxx},vo.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof Ki){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof vo){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)}},vo.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof vo){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 Ki){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)}},vo.prototype.getMinY=function(){return this._miny},vo.prototype.getMinX=function(){return this._minx},vo.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof Ki){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof vo){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))}},vo.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},vo.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},vo.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},vo.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},vo.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},vo.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},vo.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},vo.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},vo.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()}},vo.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof vo){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Ki){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)}},vo.prototype.centre=function(){return this.isNull()?null:new Ki((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},vo.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof Ki){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof vo){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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];A<i?(this._minx=A,this._maxx=i):(this._minx=i,this._maxx=A),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},vo.prototype.getMaxY=function(){return this._maxy},vo.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)},vo.prototype.hashCode=function(){var t=17;return t=37*(t=37*(t=37*(t=37*t+Ki.hashCode(this._minx))+Ki.hashCode(this._maxx))+Ki.hashCode(this._miny))+Ki.hashCode(this._maxy)},vo.prototype.interfaces_=function(){return[Hi,Wi]},vo.prototype.getClass=function(){return vo},vo.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],A=arguments[1],i=arguments[2],o=arguments[3],s=Math.min(i.x,o.x),a=Math.max(i.x,o.x),u=Math.min(r.x,A.x),c=Math.max(r.x,A.x);return!(u>a)&&(!(c<s)&&(s=Math.min(i.y,o.y),a=Math.max(i.y,o.y),u=Math.min(r.y,A.y),c=Math.max(r.y,A.y),!(u>a)&&!(c<s)))}},Eo.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(vo,Eo);var wo={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*$/},bo=function(t){this.geometryFactory=t||new aa};bo.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var A=wo.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((A=wo.emptyTypeStr.exec(t))[2]=void 0),A&&(n=A[1].toLowerCase(),r=A[2],Co[n]&&(e=Co[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},bo.prototype.write=function(t){return this.extractGeometry(t)},bo.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Io[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Io[e].apply(this,[t])+")"};var Io={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Io.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Io.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(Io.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(Io.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("("+Io.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Io.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Io.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("("+Io.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(",")}},Co={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(wo.spaces);return this.geometryFactory.createPoint(new Ki(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiPoint();for(var n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(wo.trimParens,"$1"),r.push(Co.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=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(wo.spaces),r.push(new Ki(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=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(wo.spaces),r.push(new Ki(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiLineString();for(var n=t.trim().split(wo.parenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(wo.trimParens,"$1"),r.push(Co.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){var e,n,r;if(void 0===t)return this.geometryFactory.createPolygon();for(var A,i=t.trim().split(wo.parenComma),o=[],s=0,a=i.length;s<a;++s)e=i[s].replace(wo.trimParens,"$1"),n=Co.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?A=r:o.push(r);return this.geometryFactory.createPolygon(A,o)},multipolygon:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var n=t.trim().split(wo.doubleParenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(wo.trimParens,"$1"),r.push(Co.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,A=e.length;r<A;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},xo=function(t){this.parser=new bo(t)};xo.prototype.write=function(t){return this.parser.write(t)},xo.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var No=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),So=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}(No),Do=function(){};Do.prototype.interfaces_=function(){return[]},Do.prototype.getClass=function(){return Do},Do.shouldNeverReachHere=function(){if(0===arguments.length)Do.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new So("Should never reach here"+(null!==t?": "+t:""))}},Do.isTrue=function(){var t;if(1===arguments.length)Do.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new So:new So(t)},Do.equals=function(){var t,e,n;if(2===arguments.length)Do.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new So("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var Lo=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 Ki,this._intPt[1]=new Ki,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},To={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Lo.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},Lo.prototype.getTopologySummary=function(){var t=new oo;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},Lo.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)},Lo.prototype.getIntersectionNum=function(){return this._result},Lo.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)}},Lo.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Lo.prototype.setPrecisionModel=function(t){this._precisionModel=t},Lo.prototype.isInteriorIntersection=function(){var t=this;if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],n=0;n<this._result;n++)if(!t._intPt[n].equals2D(t._inputLines[e][0])&&!t._intPt[n].equals2D(t._inputLines[e][1]))return!0;return!1}},Lo.prototype.getIntersection=function(t){return this._intPt[t]},Lo.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Lo.prototype.hasIntersection=function(){return this._result!==Lo.NO_INTERSECTION},Lo.prototype.getEdgeDistance=function(t,e){return Lo.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},Lo.prototype.isCollinear=function(){return this._result===Lo.COLLINEAR_INTERSECTION},Lo.prototype.toString=function(){return xo.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+xo.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Lo.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},Lo.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},Lo.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},Lo.prototype.interfaces_=function(){return[]},Lo.prototype.getClass=function(){return Lo},Lo.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),A=Math.abs(n.y-e.y),i=-1;if(t.equals(e))i=0;else if(t.equals(n))i=r>A?r:A;else{var o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(i=r>A?o:s)||t.equals(e)||(i=Math.max(o,s))}return Do.isTrue(!(0===i&&!t.equals(e)),"Bad distance calculation"),i},Lo.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,A=t.y-e.y,i=Math.sqrt(r*r+A*A);return Do.isTrue(!(0===i&&!t.equals(e)),"Invalid distance calculation"),i},To.DONT_INTERSECT.get=function(){return 0},To.DO_INTERSECT.get=function(){return 1},To.COLLINEAR.get=function(){return 2},To.NO_INTERSECTION.get=function(){return 0},To.POINT_INTERSECTION.get=function(){return 1},To.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Lo,To);var Mo=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 vo(this._inputLines[0][0],this._inputLines[0][1]),n=new vo(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,vo.intersects(n,r,e)&&0===Po.orientationIndex(n,r,e)&&0===Po.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,A){A.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),A.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,A){var i=null;try{i=mo.intersection(t,n,r,A)}catch(o){if(!(o instanceof yo))throw o;i=e.nearestEndpoint(t,n,r,A)}return i},e.prototype.intersection=function(t,n,r,A){var i=this.intersectionWithNormalization(t,n,r,A);return this.isInSegmentEnvelopes(i)||(i=new Ki(e.nearestEndpoint(t,n,r,A))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i},e.prototype.smallestInAbsValue=function(t,e,n,r){var A=t,i=Math.abs(A);return Math.abs(e)<i&&(A=e,i=Math.abs(e)),Math.abs(n)<i&&(A=n,i=Math.abs(n)),Math.abs(r)<i&&(A=r),A},e.prototype.checkDD=function(t,e,n,r,A){var i=lo.intersection(t,e,n,r),o=this.isInSegmentEnvelopes(i);_o.out.println("DD in env = "+o+" --------------------- "+i),A.distance(i)>1e-4&&_o.out.println("Distance = "+A.distance(i))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var A=new Ki(t),i=new Ki(e),o=new Ki(n),s=new Ki(r),a=new Ki;this.normalizeToEnvCentre(A,i,o,s,a);var u=this.safeHCoordinateIntersection(A,i,o,s);return u.x+=a.x,u.y+=a.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,A){var i=vo.intersects(e,n,r),o=vo.intersects(e,n,A),s=vo.intersects(r,A,e),a=vo.intersects(r,A,n);return i&&o?(this._intPt[0]=r,this._intPt[1]=A,t.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):i&&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]=A,this._intPt[1]=e,!A.equals(e)||i||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&a?(this._intPt[0]=A,this._intPt[1]=n,!A.equals(n)||i||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,A){var i=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=((i>u?i:u)+(s<l?s:l))/2,p=((o>c?o:c)+(a<f?a:f))/2;A.x=h,A.y=p,t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.computeIntersect=function(e,n,r,A){if(this._isProper=!1,!vo.intersects(e,n,r,A))return t.NO_INTERSECTION;var i=Po.orientationIndex(e,n,r),o=Po.orientationIndex(e,n,A);if(i>0&&o>0||i<0&&o<0)return t.NO_INTERSECTION;var s=Po.orientationIndex(r,A,e),a=Po.orientationIndex(r,A,n);return s>0&&a>0||s<0&&a<0?t.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(e,n,r,A):(0===i||0===o||0===s||0===a?(this._isProper=!1,e.equals2D(r)||e.equals2D(A)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(A)?this._intPt[0]=n:0===i?this._intPt[0]=new Ki(r):0===o?this._intPt[0]=new Ki(A):0===s?this._intPt[0]=new Ki(e):0===a&&(this._intPt[0]=new Ki(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,A)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var A=t,i=Po.distancePointLine(t,n,r),o=Po.distancePointLine(e,n,r);return o<i&&(i=o,A=e),(o=Po.distancePointLine(n,t,e))<i&&(i=o,A=n),(o=Po.distancePointLine(r,t,e))<i&&(i=o,A=r),A},e}(Lo),Oo=function(){};Oo.prototype.interfaces_=function(){return[]},Oo.prototype.getClass=function(){return Oo},Oo.orientationIndex=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=n.x-e.x,o=n.y-e.y;return Oo.signOfDet2x2(r,A,i,o)},Oo.signOfDet2x2=function(t,e,n,r){var A=null,i=null,o=null;if(A=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-A:A:n>0?A:-A;if(0===e||0===n)return r>0?t>0?A:-A:t>0?-A:A;if(e>0?r>0?e<=r||(A=-A,i=t,t=n,n=i,i=e,e=r,r=i):e<=-r?(A=-A,n=-n,r=-r):(i=t,t=-n,n=i,i=e,e=-r,r=i):r>0?-e<=r?(A=-A,t=-t,e=-e):(i=-t,t=n,n=i,i=-e,e=r,r=i):e>=r?(t=-t,e=-e,n=-n,r=-r):(A=-A,i=-t,t=-n,n=i,i=-e,e=-r,r=i),t>0){if(!(n>0))return A;if(!(t<=n))return A}else{if(n>0)return-A;if(!(t>=n))return-A;A=-A,t=-t,n=-n}for(;;){if((r-=(o=Math.floor(n/t))*e)<0)return-A;if(r>e)return A;if(t>(n-=o*t)+n){if(e<r+r)return A}else{if(e>r+r)return-A;n=t-n,r=e-r,A=-A}if(0===r)return 0===n?0:-A;if(0===n)return A;if((e-=(o=Math.floor(t/n))*r)<0)return A;if(e>r)return-A;if(n>(t-=o*n)+t){if(r<e+e)return-A}else{if(r>e+e)return A;t=n-t,e=r-e,A=-A}if(0===e)return 0===t?0:A;if(0===t)return-A}};var Ro=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Ro.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 A=t.x-this._p.x,i=t.y-this._p.y,o=e.x-this._p.x,s=e.y-this._p.y,a=Oo.signOfDet2x2(A,i,o,s);if(0===a)return this._isPointOnSegment=!0,null;s<i&&(a=-a),a>0&&this._crossingCount++}},Ro.prototype.isPointInPolygon=function(){return this.getLocation()!==eo.EXTERIOR},Ro.prototype.getLocation=function(){return this._isPointOnSegment?eo.BOUNDARY:this._crossingCount%2==1?eo.INTERIOR:eo.EXTERIOR},Ro.prototype.isOnSegment=function(){return this._isPointOnSegment},Ro.prototype.interfaces_=function(){return[]},Ro.prototype.getClass=function(){return Ro},Ro.locatePointInRing=function(){if(arguments[0]instanceof Ki&&ro(arguments[1],ho)){for(var t=arguments[1],e=new Ro(arguments[0]),n=new Ki,r=new Ki,A=1;A<t.size();A++)if(t.getCoordinate(A,n),t.getCoordinate(A-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof Ki&&arguments[1]instanceof Array){for(var i=arguments[1],o=new Ro(arguments[0]),s=1;s<i.length;s++){var a=i[s],u=i[s-1];if(o.countSegment(a,u),o.isOnSegment())return o.getLocation()}return o.getLocation()}};var Po=function(){},ko={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Po.prototype.interfaces_=function(){return[]},Po.prototype.getClass=function(){return Po},Po.orientationIndex=function(t,e,n){return lo.orientationIndex(t,e,n)},Po.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 A=t[r].x-n,i=t[r+1].y;e+=A*(t[r-1].y-i)}return e/2}if(ro(arguments[0],ho)){var o=arguments[0],s=o.size();if(s<3)return 0;var a=new Ki,u=new Ki,c=new Ki;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}},Po.distanceLineLine=function(t,e,n,r){if(t.equals(e))return Po.distancePointLine(t,n,r);if(n.equals(r))return Po.distancePointLine(r,t,e);var A=!1;if(vo.intersects(t,e,n,r)){var i=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===i)A=!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))/i,a=o/i;(a<0||a>1||s<0||s>1)&&(A=!0)}}else A=!0;return A?Ao.min(Po.distancePointLine(t,n,r),Po.distancePointLine(e,n,r),Po.distancePointLine(n,t,e),Po.distancePointLine(r,t,e)):0},Po.isPointInRing=function(t,e){return Po.locatePointInRing(t,e)!==eo.EXTERIOR},Po.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new Ki;t.getCoordinate(0,r);for(var A=r.x,i=r.y,o=1;o<e;o++){t.getCoordinate(o,r);var s=r.x,a=r.y,u=s-A,c=a-i;n+=Math.sqrt(u*u+c*c),A=s,i=a}return n},Po.isCCW=function(t){var e=t.length-1;if(e<3)throw new qi("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,A=1;A<=e;A++){var i=t[A];i.y>n.y&&(n=i,r=A)}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=Po.computeOrientation(a,n,u),l=!1;return l=0===c?a.x>u.x:c>0,l},Po.locatePointInRing=function(t,e){return Ro.locatePointInRing(t,e)},Po.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),A=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(A)*Math.sqrt(r)},Po.computeOrientation=function(t,e,n){return Po.orientationIndex(t,e,n)},Po.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new qi("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var A=Po.distancePointLine(t,e[r],e[r+1]);A<n&&(n=A)}return n}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return i.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((i.x-o.x)*(s.x-o.x)+(i.y-o.y)*(s.y-o.y))/a;if(u<=0)return i.distance(o);if(u>=1)return i.distance(s);var c=((o.y-i.y)*(s.x-o.x)-(o.x-i.x)*(s.y-o.y))/a;return Math.abs(c)*Math.sqrt(a)}},Po.isOnLine=function(t,e){for(var n=new Mo,r=1;r<e.length;r++){var A=e[r-1],i=e[r];if(n.computeIntersection(t,A,i),n.hasIntersection())return!0}return!1},ko.CLOCKWISE.get=function(){return-1},ko.RIGHT.get=function(){return Po.CLOCKWISE},ko.COUNTERCLOCKWISE.get=function(){return 1},ko.LEFT.get=function(){return Po.COUNTERCLOCKWISE},ko.COLLINEAR.get=function(){return 0},ko.STRAIGHT.get=function(){return Po.COLLINEAR},Object.defineProperties(Po,ko);var Bo=function(){};Bo.prototype.filter=function(t){},Bo.prototype.interfaces_=function(){return[]},Bo.prototype.getClass=function(){return Bo};var Fo=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Go={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}};Fo.prototype.isGeometryCollection=function(){return this.getSortIndex()===Fo.SORTINDEX_GEOMETRYCOLLECTION},Fo.prototype.getFactory=function(){return this._factory},Fo.prototype.getGeometryN=function(t){return this},Fo.prototype.getArea=function(){return 0},Fo.prototype.isRectangle=function(){return!1},Fo.prototype.equals=function(){if(arguments[0]instanceof Fo){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof Fo))return!1;var n=e;return this.equalsExact(n)}},Fo.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},Fo.prototype.geometryChanged=function(){this.apply(Fo.geometryChangedFilter)},Fo.prototype.geometryChangedAction=function(){this._envelope=null},Fo.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},Fo.prototype.getLength=function(){return 0},Fo.prototype.getNumGeometries=function(){return 1},Fo.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)}},Fo.prototype.getUserData=function(){return this._userData},Fo.prototype.getSRID=function(){return this._SRID},Fo.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Fo.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===Fo.SORTINDEX_GEOMETRYCOLLECTION)throw new qi("This method does not support GeometryCollection arguments")},Fo.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},Fo.prototype.norm=function(){var t=this.copy();return t.normalize(),t},Fo.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Fo.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new vo(this._envelope)},Fo.prototype.setSRID=function(t){this._SRID=t},Fo.prototype.setUserData=function(t){this._userData=t},Fo.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var A=n.next(),i=r.next(),o=A.compareTo(i);if(0!==o)return o}return n.hasNext()?1:r.hasNext()?-1:0},Fo.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Fo.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Fo.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Fo.SORTINDEX_MULTIPOINT||this.getSortIndex()===Fo.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Fo.SORTINDEX_MULTIPOLYGON},Fo.prototype.interfaces_=function(){return[Xi,Hi,Wi]},Fo.prototype.getClass=function(){return Fo},Fo.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},Fo.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},Go.serialVersionUID.get=function(){return 0x799ea46522854c00},Go.SORTINDEX_POINT.get=function(){return 0},Go.SORTINDEX_MULTIPOINT.get=function(){return 1},Go.SORTINDEX_LINESTRING.get=function(){return 2},Go.SORTINDEX_LINEARRING.get=function(){return 3},Go.SORTINDEX_MULTILINESTRING.get=function(){return 4},Go.SORTINDEX_POLYGON.get=function(){return 5},Go.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Go.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Go.geometryChangedFilter.get=function(){return Uo},Object.defineProperties(Fo,Go);var Uo=function(){};Uo.interfaces_=function(){return[Bo]},Uo.filter=function(t){t.geometryChangedAction()};var Qo=function(){};Qo.prototype.filter=function(t){},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo};var zo=function(){},Vo={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}};zo.prototype.isInBoundary=function(t){},zo.prototype.interfaces_=function(){return[]},zo.prototype.getClass=function(){return zo},Vo.Mod2BoundaryNodeRule.get=function(){return qo},Vo.EndPointBoundaryNodeRule.get=function(){return Yo},Vo.MultiValentEndPointBoundaryNodeRule.get=function(){return jo},Vo.MonoValentEndPointBoundaryNodeRule.get=function(){return Ho},Vo.MOD2_BOUNDARY_RULE.get=function(){return new qo},Vo.ENDPOINT_BOUNDARY_RULE.get=function(){return new Yo},Vo.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new jo},Vo.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ho},Vo.OGC_SFS_BOUNDARY_RULE.get=function(){return zo.MOD2_BOUNDARY_RULE},Object.defineProperties(zo,Vo);var qo=function(){};qo.prototype.isInBoundary=function(t){return t%2==1},qo.prototype.interfaces_=function(){return[zo]},qo.prototype.getClass=function(){return qo};var Yo=function(){};Yo.prototype.isInBoundary=function(t){return t>0},Yo.prototype.interfaces_=function(){return[zo]},Yo.prototype.getClass=function(){return Yo};var jo=function(){};jo.prototype.isInBoundary=function(t){return t>1},jo.prototype.interfaces_=function(){return[zo]},jo.prototype.getClass=function(){return jo};var Ho=function(){};Ho.prototype.isInBoundary=function(t){return 1===t},Ho.prototype.interfaces_=function(){return[zo]},Ho.prototype.getClass=function(){return Ho};var Xo=function(){};function $o(t){this.message=t||""}Xo.prototype.add=function(){},Xo.prototype.addAll=function(){},Xo.prototype.isEmpty=function(){},Xo.prototype.iterator=function(){},Xo.prototype.size=function(){},Xo.prototype.toArray=function(){},Xo.prototype.remove=function(){},$o.prototype=new Error,$o.prototype.name="IndexOutOfBoundsException";var Wo=function(){};Wo.prototype.hasNext=function(){},Wo.prototype.next=function(){},Wo.prototype.remove=function(){};var Ko=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}(Xo);function Zo(t){this.message=t||""}Zo.prototype=new Error,Zo.prototype.name="NoSuchElementException";var Jo=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Xo&&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,Xo]},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 ts(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new $o;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}(Ko),ts=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 Zo;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}(Wo),es=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),e.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(){var e=this;if(1===arguments.length){var n=arguments[0];t.prototype.add.call(this,n)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var r=arguments[0],A=arguments[1];return this.add(r,A,!0),!0}if(arguments[0]instanceof Ki&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1])if(this.size()>=1)if(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 o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c<a.length;c++)e.add(a[c],u);else for(var l=a.length-1;l>=0;l--)e.add(a[l],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof Ki){var f=arguments[0],h=arguments[1];if(!arguments[2]){var p=this.size();if(p>0){if(f>0)if(this.get(f-1).equals2D(h))return null;if(f<p)if(this.get(f).equals2D(h))return null}}t.prototype.add.call(this,f,h)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)e.add(d[v],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new Ki(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Jo),ns=function(){},rs={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};rs.ForwardComparator.get=function(){return As},rs.BidirectionalComparator.get=function(){return is},rs.coordArrayType.get=function(){return new Array(0).fill(null)},ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns},ns.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},ns.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(ns.indexOf(r,e)<0)return r}return null},ns.scroll=function(t,e){var n=ns.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);_o.arraycopy(t,n,r,0,t.length-n),_o.arraycopy(t,0,r,t.length-n,n),_o.arraycopy(r,0,t,0,t.length)},ns.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],A=arguments[1],i=arguments[2];if(r===A)return!0;if(null===r||null===A)return!1;if(r.length!==A.length)return!1;for(var o=0;o<r.length;o++)if(0!==i.compare(r[o],A[o]))return!1;return!0}},ns.intersection=function(t,e){for(var n=new es,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},ns.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},ns.removeRepeatedPoints=function(t){return ns.hasRepeatedPoints(t)?new es(t,!1).toCoordinateArray():t},ns.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var A=t[r];t[r]=t[e-r],t[e-r]=A}},ns.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 A=0,i=0;i<t.length;i++)null!==t[i]&&(r[A++]=t[i]);return r},ns.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 Ki(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],A=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=0;a<s;a++)i[o+a]=new Ki(r[A+a])},ns.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],A=e[t.length-n-1];if(0!==r.compareTo(A))return!1}return!0},ns.envelope=function(t){for(var e=new vo,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},ns.toCoordinateArray=function(t){return t.toArray(ns.coordArrayType)},ns.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},ns.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},ns.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},ns.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},ns.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},ns.extract=function(t,e,n){e=Ao.clamp(e,0,t.length);var r=(n=Ao.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var A=new Array(r).fill(null);if(0===r)return A;for(var i=0,o=e;o<=n;o++)A[i++]=t[o];return A},Object.defineProperties(ns,rs);var As=function(){};As.prototype.compare=function(t,e){return ns.compare(t,e)},As.prototype.interfaces_=function(){return[$i]},As.prototype.getClass=function(){return As};var is=function(){};is.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 A=ns.compare(n,r);return ns.isEqualReversed(n,r)?0:A},is.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 A=ns.increasingDirection(n),i=ns.increasingDirection(r),o=A>0?0:n.length-1,s=i>0?0:n.length-1,a=0;a<n.length;a++){var u=n[o].compareTo(r[s]);if(0!==u)return u;o+=A,s+=i}return 0},is.prototype.interfaces_=function(){return[$i]},is.prototype.getClass=function(){return is};var os=function(){};os.prototype.get=function(){},os.prototype.put=function(){},os.prototype.size=function(){},os.prototype.values=function(){},os.prototype.entrySet=function(){};var ss=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}(os);function as(t){this.message=t||""}function us(){}as.prototype=new Error,as.prototype.name="OperationNotSupported",us.prototype=new Xo,us.prototype.contains=function(){};var cs=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Xo&&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 ls(this)},e}(us),ls=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 Zo;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new as},e}(Wo);function fs(t){return null===t?0:t.color}function hs(t){return null===t?null:t.parent}function ps(t,e){null!==t&&(t.color=e)}function ds(t){return null===t?null:t.left}function gs(t){return null===t?null:t.right}function ys(){this.root_=null,this.size_=0}ys.prototype=new ss,ys.prototype.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},ys.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,A=this.root_;do{if(n=A,(r=t.compareTo(A.key))<0)A=A.left;else{if(!(r>0)){var i=A.value;return A.value=e,i}A=A.right}}while(null!==A);var o={key:t,left:null,right:null,value:e,parent:n,color:0,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},ys.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(hs(t)===ds(hs(hs(t)))){var n=gs(hs(hs(t)));1===fs(n)?(ps(hs(t),0),ps(n,0),ps(hs(hs(t)),1),t=hs(hs(t))):(t===gs(hs(t))&&(t=hs(t),e.rotateLeft(t)),ps(hs(t),0),ps(hs(hs(t)),1),e.rotateRight(hs(hs(t))))}else{var r=ds(hs(hs(t)));1===fs(r)?(ps(hs(t),0),ps(r,0),ps(hs(hs(t)),1),t=hs(hs(t))):(t===ds(hs(t))&&(t=hs(t),e.rotateRight(t)),ps(hs(t),0),ps(hs(hs(t)),1),e.rotateLeft(hs(hs(t))))}this.root_.color=0},ys.prototype.values=function(){var t=new Jo,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=ys.successor(e));)t.add(e.value);return t},ys.prototype.entrySet=function(){var t=new cs,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=ys.successor(e));)t.add(e);return t},ys.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}},ys.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}},ys.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},ys.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},ys.prototype.size=function(){return this.size_};var _s=function(){};function ms(){}function vs(){this.array_=[],arguments[0]instanceof Xo&&this.addAll(arguments[0])}_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s},ms.prototype=new us,vs.prototype=new ms,vs.prototype.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},vs.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},vs.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},vs.prototype.remove=function(t){throw new as},vs.prototype.size=function(){return this.array_.length},vs.prototype.isEmpty=function(){return 0===this.array_.length},vs.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},vs.prototype.iterator=function(){return new Es(this)};var Es=function(t){this.treeSet_=t,this.position_=0};Es.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Zo;return this.treeSet_.array_[this.position_++]},Es.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Es.prototype.remove=function(){throw new as};var ws=function(){};ws.sort=function(){var t,e,n,r,A=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},A.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},A.sort(r);else if(3===arguments.length){(e=A.slice(arguments[1],arguments[2])).sort();var i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length));for(A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])}else if(4===arguments.length)for(e=A.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length)),A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])},ws.asList=function(t){for(var e=new Jo,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var bs=function(){},Is={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}};Is.P.get=function(){return 0},Is.L.get=function(){return 1},Is.A.get=function(){return 2},Is.FALSE.get=function(){return-1},Is.TRUE.get=function(){return-2},Is.DONTCARE.get=function(){return-3},Is.SYM_FALSE.get=function(){return"F"},Is.SYM_TRUE.get=function(){return"T"},Is.SYM_DONTCARE.get=function(){return"*"},Is.SYM_P.get=function(){return"0"},Is.SYM_L.get=function(){return"1"},Is.SYM_A.get=function(){return"2"},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs},bs.toDimensionSymbol=function(t){switch(t){case bs.FALSE:return bs.SYM_FALSE;case bs.TRUE:return bs.SYM_TRUE;case bs.DONTCARE:return bs.SYM_DONTCARE;case bs.P:return bs.SYM_P;case bs.L:return bs.SYM_L;case bs.A:return bs.SYM_A}throw new qi("Unknown dimension value: "+t)},bs.toDimensionValue=function(t){switch(ao.toUpperCase(t)){case bs.SYM_FALSE:return bs.FALSE;case bs.SYM_TRUE:return bs.TRUE;case bs.SYM_DONTCARE:return bs.DONTCARE;case bs.SYM_P:return bs.P;case bs.SYM_L:return bs.L;case bs.SYM_A:return bs.A}throw new qi("Unknown dimension symbol: "+t)},Object.defineProperties(bs,Is);var Cs=function(){};Cs.prototype.filter=function(t){},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs};var xs=function(){};xs.prototype.filter=function(t,e){},xs.prototype.isDone=function(){},xs.prototype.isGeometryChanged=function(){},xs.prototype.interfaces_=function(){return[]},xs.prototype.getClass=function(){return xs};var Ns=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new qi("geometries must not contain null elements")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new vo,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(),A=0;A<r.length;A++)t[++e]=r[A];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 A=0;A<this._geometries.length;A++)if(!this._geometries[A].equalsExact(r._geometries[A],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();ws.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=bs.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=bs.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 vs(ws.asList(this._geometries)),n=new vs(ws.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],A=arguments[0],i=this.getNumGeometries(),o=A.getNumGeometries(),s=0;s<i&&s<o;){var a=this.getGeometryN(s),u=A.getGeometryN(s),c=a.compareToSameClass(u,r);if(0!==c)return c;s++}return s<i?1:s<o?-1:0}},e.prototype.apply=function(){var t=this;if(ro(arguments[0],Qo))for(var e=arguments[0],n=0;n<this._geometries.length;n++)t._geometries[n].apply(e);else if(ro(arguments[0],xs)){var r=arguments[0];if(0===this._geometries.length)return null;for(var A=0;A<this._geometries.length&&(t._geometries[A].apply(r),!r.isDone());A++);r.isGeometryChanged()&&this.geometryChanged()}else if(ro(arguments[0],Cs)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)t._geometries[o].apply(i)}else if(ro(arguments[0],Bo)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)t._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Do.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}(Fo),Ss=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Fo.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()?bs.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 Ds(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[_s]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Ns),Ds=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=zo.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}};Ds.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)},Ds.prototype.getBoundary=function(){return this._geom instanceof Us?this.boundaryLineString(this._geom):this._geom instanceof Ss?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Ds.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()])},Ds.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Ds.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new Jo;this._endpointMap=new ys;for(var r=0;r<t.getNumGeometries();r++){var A=t.getGeometryN(r);0!==A.getNumPoints()&&(e.addEndpoint(A.getCoordinateN(0)),e.addEndpoint(A.getCoordinateN(A.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;e._bnRule.isInBoundary(s)&&n.add(o.getKey())}return ns.toCoordinateArray(n)},Ds.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Ls,this._endpointMap.put(t,e)),e.count++},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds},Ds.getBoundary=function(){return 1===arguments.length?new Ds(arguments[0]).getBoundary():2===arguments.length?new Ds(arguments[0],arguments[1]).getBoundary():void 0};var Ls=function(){this.count=null};function Ts(){}function Ms(){}Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Os=function(){};function Rs(){}function Ps(){}function ks(){}var Bs=function(){},Fs={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs},Bs.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Bs.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new Rs,n=new Ts;return t.printStackTrace(n),e.toString()}if(2===arguments.length){var r=arguments[1],A="";new Ms(Bs.getStackTrace(arguments[0]));for(var i=new ks,o=0;o<r;o++)try{A+=i.readLine()+Bs.NEWLINE}catch(t){if(!(t instanceof Ps))throw t;Do.shouldNeverReachHere()}return A}},Bs.split=function(t,e){for(var n=e.length,r=new Jo,A=""+t,i=A.indexOf(e);i>=0;){var o=A.substring(0,i);r.add(o),i=(A=A.substring(i+n)).indexOf(e)}A.length>0&&r.add(A);for(var s=new Array(r.size()).fill(null),a=0;a<s.length;a++)s[a]=r.get(a);return s},Bs.toString=function(){if(1===arguments.length){var t=arguments[0];return Bs.SIMPLE_ORDINATE_FORMAT.format(t)}},Bs.spaces=function(t){return Bs.chars(" ",t)},Fs.NEWLINE.get=function(){return _o.getProperty("line.separator")},Fs.SIMPLE_ORDINATE_FORMAT.get=function(){return new Os},Object.defineProperties(Bs,Fs);var Gs=function(){};Gs.prototype.interfaces_=function(){return[]},Gs.prototype.getClass=function(){return Gs},Gs.copyCoord=function(t,e,n,r){for(var A=Math.min(t.getDimension(),n.getDimension()),i=0;i<A;i++)n.setOrdinate(r,i,t.getOrdinate(e,i))},Gs.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&(t.getOrdinate(0,ho.X)===t.getOrdinate(e-1,ho.X)&&t.getOrdinate(0,ho.Y)===t.getOrdinate(e-1,ho.Y))},Gs.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),A=0;A<n;A++)for(var i=0;i<r;i++){var o=t.getOrdinate(A,i),s=e.getOrdinate(A,i);if(t.getOrdinate(A,i)!==e.getOrdinate(A,i)&&(!Yi.isNaN(o)||!Yi.isNaN(s)))return!1}return!0},Gs.extend=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();if(Gs.copy(e,0,r,0,A),A>0)for(var i=A;i<n;i++)Gs.copy(e,A-1,r,i,1);return r},Gs.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Gs.swap(t,r,e-r)},Gs.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var A=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,A)}},Gs.copy=function(t,e,n,r,A){for(var i=0;i<A;i++)Gs.copyCoord(t,e+i,n,r+i)},Gs.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new oo;r.append("(");for(var A=0;A<e;A++){A>0&&r.append(" ");for(var i=0;i<n;i++)i>0&&r.append(","),r.append(Bs.toString(t.getOrdinate(A,i)))}return r.append(")"),r.toString()}},Gs.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Gs.createClosedRing(t,e,4):e.getOrdinate(0,ho.X)===e.getOrdinate(n-1,ho.X)&&e.getOrdinate(0,ho.Y)===e.getOrdinate(n-1,ho.Y)?e:Gs.createClosedRing(t,e,n+1)},Gs.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();Gs.copy(e,0,r,0,A);for(var i=A;i<n;i++)Gs.copy(e,0,r,i,1);return r};var Us=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),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new vo:this._points.expandEnvelope(new vo)},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 A=0;A<this._points.size();A++)if(!this.equal(this._points.getCoordinate(A),r._points.getCoordinate(A),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=this,e=0;e<Math.trunc(this._points.size()/2);e++){var n=t._points.size()-1-e;if(!t._points.getCoordinate(e).equals(t._points.getCoordinate(n)))return t._points.getCoordinate(e).compareTo(t._points.getCoordinate(n))>0&&Gs.reverse(t._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?bs.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 Po.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Gs.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 A=arguments[0];return arguments[1].compare(this._points,A._points)}},e.prototype.apply=function(){if(ro(arguments[0],Qo))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(ro(arguments[0],xs)){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 if(ro(arguments[0],Cs)){arguments[0].filter(this)}else if(ro(arguments[0],Bo)){arguments[0].filter(this)}},e.prototype.getBoundary=function(){return new Ds(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 qi("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[_s]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(Fo),Qs=function(){};Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs};var zs=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),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new vo;var t=new vo;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 bs.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(ro(arguments[0],Qo)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(ro(arguments[0],xs)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else if(ro(arguments[0],Cs)){arguments[0].filter(this)}else if(ro(arguments[0],Bo)){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([])),Do.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Qs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(Fo),Vs=function(){};Vs.prototype.interfaces_=function(){return[]},Vs.prototype.getClass=function(){return Vs};var qs=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 qi("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new qi("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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 A=0;A<this._holes.length;A++)for(var i=this._holes[A].getCoordinates(),o=0;o<i.length;o++)t[++e]=i[o];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(Po.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(Po.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 A=t.getY(n);if(A!==e.getMinY()&&A!==e.getMaxY())return!1}for(var i=t.getX(0),o=t.getY(0),s=1;s<=4;s++){var a=t.getX(s),u=t.getY(s);if(a!==i===(u!==o))return!1;i=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,A=this._shell,i=r._shell;if(!A.equalsExact(i,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);ws.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);_o.arraycopy(e.getCoordinates(),0,r,0,r.length);var A=ns.minCoordinate(e.getCoordinates());ns.scroll(r,A),_o.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],Po.isCCW(e.getCoordinates())===n&&ns.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],A=arguments[0],i=this._shell,o=A._shell,s=i.compareToSameClass(o,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=A.getNumInteriorRing(),c=0;c<a&&c<u;){var l=this.getInteriorRingN(c),f=A.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){var e=this;if(ro(t,Qo)){this._shell.apply(t);for(var n=0;n<this._holes.length;n++)e._holes[n].apply(t)}else if(ro(t,xs)){if(this._shell.apply(t),!t.isDone())for(var r=0;r<this._holes.length&&(e._holes[r].apply(t),!t.isDone());r++);t.isGeometryChanged()&&this.geometryChanged()}else if(ro(t,Cs))t.filter(this);else if(ro(t,Bo)){t.filter(this),this._shell.apply(t);for(var A=0;A<this._holes.length;A++)e._holes[A].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[Vs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(Fo),Ys=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Fo.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 bs.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[Qs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Ns),js=function(t){function e(e,n){e instanceof Ki&&n instanceof aa&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Fo.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return bs.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Gs.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new qi("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new qi("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}(Us),Hs=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Fo.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 Jo,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 A=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(A))},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[Vs]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Ns),Xs=function(t){this._factory=t||null,this._isUserDataCopied=!1},$s={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Xs.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Xs.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Xs.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Ns?this.editGeometryCollection(t,e):t instanceof qs?this.editPolygon(t,e):t instanceof zs||t instanceof Us?e.edit(t,this._factory):(Do.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Xs.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Jo,A=0;A<n.getNumGeometries();A++){var i=this.edit(n.getGeometryN(A),e);null===i||i.isEmpty()||r.add(i)}return n.getClass()===Ys?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Ss?this._factory.createMultiLineString(r.toArray([])):n.getClass()===Hs?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},Xs.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 A=new Jo,i=0;i<n.getNumInteriorRing();i++){var o=this.edit(n.getInteriorRingN(i),e);null===o||o.isEmpty()||A.add(o)}return this._factory.createPolygon(r,A.toArray([]))},Xs.prototype.interfaces_=function(){return[]},Xs.prototype.getClass=function(){return Xs},Xs.GeometryEditorOperation=function(){},$s.NoOpGeometryOperation.get=function(){return Ws},$s.CoordinateOperation.get=function(){return Ks},$s.CoordinateSequenceOperation.get=function(){return Zs},Object.defineProperties(Xs,$s);var Ws=function(){};Ws.prototype.edit=function(t,e){return t},Ws.prototype.interfaces_=function(){return[Xs.GeometryEditorOperation]},Ws.prototype.getClass=function(){return Ws};var Ks=function(){};Ks.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof js?e.createLinearRing(n):t instanceof Us?e.createLineString(n):t instanceof zs?n.length>0?e.createPoint(n[0]):e.createPoint():t},Ks.prototype.interfaces_=function(){return[Xs.GeometryEditorOperation]},Ks.prototype.getClass=function(){return Ks};var Zs=function(){};Zs.prototype.edit=function(t,e){return t instanceof js?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Us?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof zs?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Zs.prototype.interfaces_=function(){return[Xs.GeometryEditorOperation]},Zs.prototype.getClass=function(){return Zs};var Js=function(){var t=this;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 e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new Ki}else if(ro(arguments[0],ho)){var r=arguments[0];if(null===r)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var A=0;A<this._coordinates.length;A++)t._coordinates[A]=r.getCoordinateCopy(A)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)t._coordinates[u]=new Ki}},ta={serialVersionUID:{configurable:!0}};Js.prototype.setOrdinate=function(t,e,n){switch(e){case ho.X:this._coordinates[t].x=n;break;case ho.Y:this._coordinates[t].y=n;break;case ho.Z:this._coordinates[t].z=n;break;default:throw new qi("invalid ordinateIndex")}},Js.prototype.size=function(){return this._coordinates.length},Js.prototype.getOrdinate=function(t,e){switch(e){case ho.X:return this._coordinates[t].x;case ho.Y:return this._coordinates[t].y;case ho.Z:return this._coordinates[t].z}return Yi.NaN},Js.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}},Js.prototype.getCoordinateCopy=function(t){return new Ki(this._coordinates[t])},Js.prototype.getDimension=function(){return this._dimension},Js.prototype.getX=function(t){return this._coordinates[t].x},Js.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 Js(t,this._dimension)},Js.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},Js.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 Js(t,this._dimension)},Js.prototype.toString=function(){if(this._coordinates.length>0){var t=new oo(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"()"},Js.prototype.getY=function(t){return this._coordinates[t].y},Js.prototype.toCoordinateArray=function(){return this._coordinates},Js.prototype.interfaces_=function(){return[ho,Wi]},Js.prototype.getClass=function(){return Js},ta.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Js,ta);var ea=function(){},na={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ea.prototype.readResolve=function(){return ea.instance()},ea.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new Js(arguments[0]);if(ro(arguments[0],ho))return new Js(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new Js(t):new Js(t,e)}},ea.prototype.interfaces_=function(){return[to,Wi]},ea.prototype.getClass=function(){return ea},ea.instance=function(){return ea.instanceObject},na.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},na.instanceObject.get=function(){return new ea},Object.defineProperties(ea,na);var ra=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 Jo,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 cs;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(os),Aa=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 oa){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}},ia={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Aa.prototype.equals=function(t){if(!(t instanceof Aa))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Aa.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new so(n).compareTo(new so(r))},Aa.prototype.getScale=function(){return this._scale},Aa.prototype.isFloating=function(){return this._modelType===Aa.FLOATING||this._modelType===Aa.FLOATING_SINGLE},Aa.prototype.getType=function(){return this._modelType},Aa.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Aa.FLOATING?t="Floating":this._modelType===Aa.FLOATING_SINGLE?t="Floating-Single":this._modelType===Aa.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Aa.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return Yi.isNaN(t)||this._modelType===Aa.FLOATING_SINGLE?t:this._modelType===Aa.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof Ki){var e=arguments[0];if(this._modelType===Aa.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Aa.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Aa.FLOATING?t=16:this._modelType===Aa.FLOATING_SINGLE?t=6:this._modelType===Aa.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Aa.prototype.setScale=function(t){this._scale=Math.abs(t)},Aa.prototype.interfaces_=function(){return[Wi,Hi]},Aa.prototype.getClass=function(){return Aa},Aa.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},ia.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},ia.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Aa,ia);var oa=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},sa={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};oa.prototype.readResolve=function(){return oa.nameToTypeMap.get(this._name)},oa.prototype.toString=function(){return this._name},oa.prototype.interfaces_=function(){return[Wi]},oa.prototype.getClass=function(){return oa},sa.serialVersionUID.get=function(){return-552860263173159e4},sa.nameToTypeMap.get=function(){return new ra},Object.defineProperties(oa,sa),Aa.Type=oa,Aa.FIXED=new oa("FIXED"),Aa.FLOATING=new oa("FLOATING"),Aa.FLOATING_SINGLE=new oa("FLOATING SINGLE");var aa=function t(){this._precisionModel=new Aa,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?ro(arguments[0],to)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Aa&&(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]))},ua={serialVersionUID:{configurable:!0}};aa.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Ki(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Ki(t.getMinX(),t.getMinY()),new Ki(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Ki(t.getMinX(),t.getMinY()),new Ki(t.getMinX(),t.getMaxY()),new Ki(t.getMaxX(),t.getMaxY()),new Ki(t.getMaxX(),t.getMinY()),new Ki(t.getMinX(),t.getMinY())]),null)},aa.prototype.createLineString=function(t){return t?t instanceof Array?new Us(this.getCoordinateSequenceFactory().create(t),this):ro(t,ho)?new Us(t,this):void 0:new Us(this.getCoordinateSequenceFactory().create([]),this)},aa.prototype.createMultiLineString=function(){return 0===arguments.length?new Ss(null,this):1===arguments.length?new Ss(arguments[0],this):void 0},aa.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,A=t.iterator();A.hasNext();){var i=A.next(),o=i.getClass();null===e&&(e=o),o!==e&&(n=!0),i.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(aa.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof qs)return this.createMultiPolygon(aa.toPolygonArray(t));if(s instanceof Us)return this.createMultiLineString(aa.toLineStringArray(t));if(s instanceof zs)return this.createMultiPoint(aa.toPointArray(t));Do.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},aa.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},aa.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Ki){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(ro(arguments[0],ho))return new zs(arguments[0],this)}},aa.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},aa.prototype.createPolygon=function(){if(0===arguments.length)return new qs(null,null,this);if(1===arguments.length){if(ro(arguments[0],ho)){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 js){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){return new qs(arguments[0],arguments[1],this)}},aa.prototype.getSRID=function(){return this._SRID},aa.prototype.createGeometryCollection=function(){return 0===arguments.length?new Ns(null,this):1===arguments.length?new Ns(arguments[0],this):void 0},aa.prototype.createGeometry=function(t){return new Xs(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},aa.prototype.getPrecisionModel=function(){return this._precisionModel},aa.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(ro(arguments[0],ho))return new js(arguments[0],this)}},aa.prototype.createMultiPolygon=function(){return 0===arguments.length?new Hs(null,this):1===arguments.length?new Hs(arguments[0],this):void 0},aa.prototype.createMultiPoint=function(){if(0===arguments.length)return new Ys(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Ys(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(ro(arguments[0],ho)){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 A=this.getCoordinateSequenceFactory().create(1,e.getDimension());Gs.copy(e,r,A,0,1),n[r]=this.createPoint(A)}return this.createMultiPoint(n)}}},aa.prototype.interfaces_=function(){return[Wi]},aa.prototype.getClass=function(){return aa},aa.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.getDefaultCoordinateSequenceFactory=function(){return ea.instance()},aa.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},aa.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ua.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(aa,ua);var ca=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],la=function(t){this.geometryFactory=t||new aa};la.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!fa[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ca.indexOf(n)?fa[n].apply(this,[e.coordinates]):"GeometryCollection"===n?fa[n].apply(this,[e.geometries]):fa[n].apply(this,[e])},la.prototype.write=function(t){var e=t.getGeometryType();if(!ha[e])throw new Error("Geometry is not supported");return ha[e].apply(this,[t])};var fa={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!fa[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=fa.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 Ki(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new Ki(t[0],t[1]),new Ki(t[2],t[1]),new Ki(t[2],t[3]),new Ki(t[0],t[3]),new Ki(t[0],t[1])])},Point:function(t){var e=new Ki(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(fa.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=fa.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(fa.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=fa.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],A=1;A<t.length;++A){var i=t[A],o=fa.coordinates.apply(this,[i]),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(fa.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)}},ha={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:ha.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=ha.Point.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var A=n[r];e.push(ha.coordinate.apply(this,[A]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=ha.LineString.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=ha.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var A=t._holes[r],i=ha.LineString.apply(this,[A]);e.push(i.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=ha.Polygon.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=r.getGeometryType();e.push(ha[A].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},pa=function(t){this.geometryFactory=t||new aa,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new la(this.geometryFactory)};pa.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Aa.FIXED&&this.reducePrecision(e),e},pa.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 da=function(){this.parser=new la(this.geometryFactory)};da.prototype.write=function(t){return this.parser.write(t)};var ga=function(){},ya={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};function _a(t){this.message=t||""}function ma(){this.array_=[]}ga.prototype.interfaces_=function(){return[]},ga.prototype.getClass=function(){return ga},ga.opposite=function(t){return t===ga.LEFT?ga.RIGHT:t===ga.RIGHT?ga.LEFT:t},ya.ON.get=function(){return 0},ya.LEFT.get=function(){return 1},ya.RIGHT.get=function(){return 2},Object.defineProperties(ga,ya),_a.prototype=new Error,_a.prototype.name="EmptyStackException",ma.prototype=new Ko,ma.prototype.add=function(t){return this.array_.push(t),!0},ma.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},ma.prototype.push=function(t){return this.array_.push(t),t},ma.prototype.pop=function(t){if(0===this.array_.length)throw new _a;return this.array_.pop()},ma.prototype.peek=function(){if(0===this.array_.length)throw new _a;return this.array_[this.array_.length-1]},ma.prototype.empty=function(){return 0===this.array_.length},ma.prototype.isEmpty=function(){return this.empty()},ma.prototype.search=function(t){return this.array_.indexOf(t)},ma.prototype.size=function(){return this.array_.length},ma.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var va=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};va.prototype.getCoordinate=function(){return this._minCoord},va.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},va.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Do.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=Po.computeOrientation(this._minCoord,n,e),A=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===Po.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===Po.CLOCKWISE)&&(A=!0),A&&(this._minIndex=this._minIndex-1)},va.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=ga.LEFT;return n[e].y<n[e+1].y&&(r=ga.RIGHT),r},va.prototype.getEdge=function(){return this._orientedDe},va.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),r=0;r<n.length-1;r++)(null===e._minCoord||n[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])},va.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)},va.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}Do.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)===ga.LEFT&&(this._orientedDe=this._minDe.getSym())},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var Ea=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new Ki(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}(No),wa=function(){this.array_=[]};wa.prototype.addLast=function(t){this.array_.push(t)},wa.prototype.removeFirst=function(){return this.array_.shift()},wa.prototype.isEmpty=function(){return 0===this.array_.length};var ba=function(){this._finder=null,this._dirEdgeList=new Jo,this._nodes=new Jo,this._rightMostCoord=null,this._env=null,this._finder=new va};ba.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},ba.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},ba.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 Ea("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var A=t.getEdges().iterator();A.hasNext();){var i=A.next();i.setVisited(!0),this.copySymDepths(i)}},ba.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(ga.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},ba.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},ba.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(ga.RIGHT)>=1&&e.getDepth(ga.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ba.prototype.computeDepths=function(t){var e=new cs,n=new wa,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var A=n.removeFirst();e.add(A),this.computeNodeDepth(A);for(var i=A.getEdges().iterator();i.hasNext();){var o=i.next().getSym();if(!o.isVisited()){var s=o.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},ba.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},ba.prototype.getEnvelope=function(){if(null===this._env){for(var t=new vo,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},ba.prototype.addReachable=function(t){var e=new ma;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},ba.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(ga.LEFT,t.getDepth(ga.RIGHT)),e.setDepth(ga.RIGHT,t.getDepth(ga.LEFT))},ba.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 A=r.getSym().getNode();A.isVisited()||e.push(A)}},ba.prototype.getNodes=function(){return this._nodes},ba.prototype.getDirectedEdges=function(){return this._dirEdgeList},ba.prototype.interfaces_=function(){return[Hi]},ba.prototype.getClass=function(){return ba};var Ia=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[ga.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var A=0;A<this.location.length;A++)this.location[A]=r.location[A]}}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[ga.ON]=i,this.location[ga.LEFT]=o,this.location[ga.RIGHT]=s}};Ia.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Ia.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==eo.NONE)return!1;return!0},Ia.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===eo.NONE&&(this.location[e]=t)},Ia.prototype.isLine=function(){return 1===this.location.length},Ia.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[ga.ON]=this.location[ga.ON],e[ga.LEFT]=eo.NONE,e[ga.RIGHT]=eo.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===eo.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Ia.prototype.getLocations=function(){return this.location},Ia.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[ga.LEFT];this.location[ga.LEFT]=this.location[ga.RIGHT],this.location[ga.RIGHT]=t},Ia.prototype.toString=function(){var t=new oo;return this.location.length>1&&t.append(eo.toLocationSymbol(this.location[ga.LEFT])),t.append(eo.toLocationSymbol(this.location[ga.ON])),this.location.length>1&&t.append(eo.toLocationSymbol(this.location[ga.RIGHT])),t.toString()},Ia.prototype.setLocations=function(t,e,n){this.location[ga.ON]=t,this.location[ga.LEFT]=e,this.location[ga.RIGHT]=n},Ia.prototype.get=function(t){return t<this.location.length?this.location[t]:eo.NONE},Ia.prototype.isArea=function(){return this.location.length>1},Ia.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===eo.NONE)return!0;return!1},Ia.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(ga.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Ia.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(eo.NONE)},Ia.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Ia.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Ia.prototype.interfaces_=function(){return[]},Ia.prototype.getClass=function(){return Ia};var Ca=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 Ia(e),this.elt[1]=new Ia(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Ia(n.elt[0]),this.elt[1]=new Ia(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.elt[0]=new Ia(eo.NONE),this.elt[1]=new Ia(eo.NONE),this.elt[r].setLocation(A)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Ia(i,o,s),this.elt[1]=new Ia(i,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new Ia(eo.NONE,eo.NONE,eo.NONE),this.elt[1]=new Ia(eo.NONE,eo.NONE,eo.NONE),this.elt[a].setLocations(u,c,l)}};Ca.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Ca.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Ca.prototype.isNull=function(t){return this.elt[t].isNull()},Ca.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)}},Ca.prototype.isLine=function(t){return this.elt[t].isLine()},Ca.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)null===e.elt[n]&&null!==t.elt[n]?e.elt[n]=new Ia(t.elt[n]):e.elt[n].merge(t.elt[n])},Ca.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Ca.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(ga.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Ca.prototype.toString=function(){var t=new oo;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()},Ca.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()}},Ca.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Ca.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(ga.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this.elt[n].setLocation(r,A)}},Ca.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Ca.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Ca.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Ia(this.elt[t].location[0]))},Ca.prototype.interfaces_=function(){return[]},Ca.prototype.getClass=function(){return Ca},Ca.toLineLabel=function(t){for(var e=new Ca(eo.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var xa=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Jo,this._pts=new Jo,this._label=new Ca(eo.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Jo,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};xa.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=Po.isCCW(this._ring.getCoordinates())},xa.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},xa.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,r=!0;do{if(null===n)throw new Ea("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Ea("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var A=n.getLabel();Do.isTrue(A.isArea()),e.mergeLabel(A),e.addPoints(n.getEdge(),n.isForward(),r),r=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},xa.prototype.getLinearRing=function(){return this._ring},xa.prototype.getCoordinate=function(t){return this._pts.get(t)},xa.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode().getEdges().getOutgoingDegree(t);n>t._maxNodeDegree&&(t._maxNodeDegree=n),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},xa.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var A=1;n&&(A=0);for(var i=A;i<r.length;i++)this._pts.add(r[i])}else{var o=r.length-2;n&&(o=r.length-1);for(var s=o;s>=0;s--)this._pts.add(r[s])}},xa.prototype.isHole=function(){return this._isHole},xa.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},xa.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Po.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},xa.prototype.addHole=function(t){this._holes.add(t)},xa.prototype.isShell=function(){return null===this._shell},xa.prototype.getLabel=function(){return this._label},xa.prototype.getEdges=function(){return this._edges},xa.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},xa.prototype.getShell=function(){return this._shell},xa.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,ga.RIGHT);if(n===eo.NONE)return null;if(this._label.getLocation(e)===eo.NONE)return this._label.setLocation(e,n),null}},xa.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},xa.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)},xa.prototype.interfaces_=function(){return[]},xa.prototype.getClass=function(){return xa};var Na=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}(xa),Sa=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 Jo,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Na(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}(xa),Da=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}};Da.prototype.setVisited=function(t){this._isVisited=t},Da.prototype.setInResult=function(t){this._isInResult=t},Da.prototype.isCovered=function(){return this._isCovered},Da.prototype.isCoveredSet=function(){return this._isCoveredSet},Da.prototype.setLabel=function(t){this._label=t},Da.prototype.getLabel=function(){return this._label},Da.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Da.prototype.updateIM=function(t){Do.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Da.prototype.isInResult=function(){return this._isInResult},Da.prototype.isVisited=function(){return this._isVisited},Da.prototype.interfaces_=function(){return[]},Da.prototype.getClass=function(){return Da};var La=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 Ca(0,eo.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=eo.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==eo.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 Ca(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var t=this;if(arguments[0]instanceof e){var n=arguments[0];this.mergeLabel(n._label)}else if(arguments[0]instanceof Ca)for(var r=arguments[0],A=0;A<2;A++){var i=t.computeMergedLocation(r,A);t._label.getLocation(A)===eo.NONE&&t._label.setLocation(A,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=eo.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;if(e===eo.BOUNDARY)n=eo.INTERIOR;else n=eo.BOUNDARY;this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Da),Ta=function(){this.nodeMap=new ys,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ta.prototype.find=function(t){return this.nodeMap.get(t)},Ta.prototype.addNode=function(){if(arguments[0]instanceof Ki){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 La){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Ta.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Ta.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ta.prototype.values=function(){return this.nodeMap.values()},Ta.prototype.getBoundaryNodes=function(t){for(var e=new Jo,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===eo.BOUNDARY&&e.add(r)}return e},Ta.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ta.prototype.interfaces_=function(){return[]},Ta.prototype.getClass=function(){return Ta};var Ma=function(){},Oa={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ma.prototype.interfaces_=function(){return[]},Ma.prototype.getClass=function(){return Ma},Ma.isNorthern=function(t){return t===Ma.NE||t===Ma.NW},Ma.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},Ma.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},Ma.isInHalfPlane=function(t,e){return e===Ma.SE?t===Ma.SE||t===Ma.SW:t===e||t===e+1},Ma.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 qi("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ma.NE:Ma.SE:e>=0?Ma.NW:Ma.SW}if(arguments[0]instanceof Ki&&arguments[1]instanceof Ki){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new qi("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ma.NE:Ma.SE:r.y>=n.y?Ma.NW:Ma.SW}},Oa.NE.get=function(){return 0},Oa.NW.get=function(){return 1},Oa.SW.get=function(){return 2},Oa.SE.get=function(){return 3},Object.defineProperties(Ma,Oa);var Ra=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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._edge=A,this.init(i,o),this._label=s}};Ra.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:Po.computeOrientation(t._p0,t._p1,this._p1)},Ra.prototype.getDy=function(){return this._dy},Ra.prototype.getCoordinate=function(){return this._p0},Ra.prototype.setNode=function(t){this._node=t},Ra.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),A=n.substring(r+1);t.print(" "+A+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Ra.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ra.prototype.getDirectedCoordinate=function(){return this._p1},Ra.prototype.getDx=function(){return this._dx},Ra.prototype.getLabel=function(){return this._label},Ra.prototype.getEdge=function(){return this._edge},Ra.prototype.getQuadrant=function(){return this._quadrant},Ra.prototype.getNode=function(){return this._node},Ra.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},Ra.prototype.computeLabel=function(t){},Ra.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=Ma.quadrant(this._dx,this._dy),Do.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ra.prototype.interfaces_=function(){return[Hi]},Ra.prototype.getClass=function(){return Ra};var Pa=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 Ca(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 Ea("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=this,e=!0,n=0;n<2;n++)t._label.isArea(n)&&t._label.getLocation(n,ga.LEFT)===eo.INTERIOR&&t._label.getLocation(n,ga.RIGHT)===eo.INTERIOR||(e=!1);return e},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[ga.LEFT]+"/"+this._depth[ga.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,eo.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,eo.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===ga.LEFT&&(r=-1);var A=ga.opposite(t),i=e+n*r;this.setDepth(t,e),this.setDepth(A,i)},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===eo.EXTERIOR&&e===eo.INTERIOR?1:t===eo.INTERIOR&&e===eo.EXTERIOR?-1:0},e}(Ra),ka=function(){};ka.prototype.createNode=function(t){return new La(t,null)},ka.prototype.interfaces_=function(){return[]},ka.prototype.getClass=function(){return ka};var Ba=function(){if(this._edges=new Jo,this._nodes=null,this._edgeEndList=new Jo,0===arguments.length)this._nodes=new Ta(new ka);else if(1===arguments.length){var t=arguments[0];this._nodes=new Ta(t)}};Ba.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)}},Ba.prototype.find=function(t){return this._nodes.find(t)},Ba.prototype.addNode=function(){if(arguments[0]instanceof La){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof Ki){var e=arguments[0];return this._nodes.addNode(e)}},Ba.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ba.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){t.next().getEdges().linkResultDirectedEdges()}},Ba.prototype.debugPrintln=function(t){_o.out.println(t)},Ba.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)===eo.BOUNDARY},Ba.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){t.next().getEdges().linkAllDirectedEdges()}},Ba.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&(Po.computeOrientation(t,e,r)===Po.COLLINEAR&&Ma.quadrant(t,e)===Ma.quadrant(n,r))},Ba.prototype.getEdgeEnds=function(){return this._edgeEndList},Ba.prototype.debugPrint=function(t){_o.out.print(t)},Ba.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ba.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var A=n._edges.get(r),i=A.getCoordinates();if(n.matchInSameDirection(t,e,i[0],i[1]))return A;if(n.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return A}return null},Ba.prototype.insertEdge=function(t){this._edges.add(t)},Ba.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ba.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();e._edges.add(r);var A=new Pa(r,!0),i=new Pa(r,!1);A.setSym(i),i.setSym(A),e.add(A),e.add(i)}},Ba.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ba.prototype.getNodes=function(){return this._nodes.values()},Ba.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),A=r.getCoordinates();if(t.equals(A[0])&&e.equals(A[1]))return r}return null},Ba.prototype.interfaces_=function(){return[]},Ba.prototype.getClass=function(){return Ba},Ba.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){e.next().getEdges().linkResultDirectedEdges()}};var Fa=function(){this._geometryFactory=null,this._shellList=new Jo;var t=arguments[0];this._geometryFactory=t};Fa.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var A=r.next();A.isHole()?n.add(A):e.add(A)}},Fa.prototype.computePolygons=function(t){for(var e=new Jo,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Fa.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var A=this.findEdgeRingContaining(r,t);if(null===A)throw new Ea("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(A)}}},Fa.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Jo,A=t.iterator();A.hasNext();){var i=A.next();if(i.getMaxNodeDegree()>2){i.linkDirectedEdgesForMinimalEdgeRings();var o=i.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),e.add(s)):n.addAll(o)}else r.add(i)}return r},Fa.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},Fa.prototype.buildMaximalEdgeRings=function(t){for(var e=new Jo,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var A=new Sa(r,this._geometryFactory);e.add(A),A.setInResult()}}return e},Fa.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Fa.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Fa.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),A=n.getCoordinateN(0),i=null,o=null,s=e.iterator();s.hasNext();){var a=s.next(),u=a.getLinearRing(),c=u.getEnvelopeInternal();null!==i&&(o=i.getLinearRing().getEnvelopeInternal());var l=!1;c.contains(r)&&Po.isPointInRing(A,u.getCoordinates())&&(l=!0),l&&(null===i||o.contains(c))&&(i=a)}return i},Fa.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var A=r.next();A.isHole()||(n=A,e++)}return Do.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Fa.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];Ba.linkResultDirectedEdges(arguments[1]);var n=this.buildMaximalEdgeRings(e),r=new Jo,A=this.buildMinimalEdgeRings(n,this._shellList,r);this.sortShellsAndHoles(A,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},Fa.prototype.interfaces_=function(){return[]},Fa.prototype.getClass=function(){return Fa};var Ga=function(){};Ga.prototype.getBounds=function(){},Ga.prototype.interfaces_=function(){return[]},Ga.prototype.getClass=function(){return Ga};var Ua=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ua.prototype.getItem=function(){return this._item},Ua.prototype.getBounds=function(){return this._bounds},Ua.prototype.interfaces_=function(){return[Ga,Wi]},Ua.prototype.getClass=function(){return Ua};var Qa=function(){this._size=null,this._items=null,this._size=0,this._items=new Jo,this._items.add(null)};Qa.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},Qa.prototype.size=function(){return this._size},Qa.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);2*t<=this._size&&((n=2*t)!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)},Qa.prototype.clear=function(){this._size=0,this._items.clear()},Qa.prototype.isEmpty=function(){return 0===this._size},Qa.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)},Qa.prototype.interfaces_=function(){return[]},Qa.prototype.getClass=function(){return Qa};var za=function(){};za.prototype.visitItem=function(t){},za.prototype.interfaces_=function(){return[]},za.prototype.getClass=function(){return za};var Va=function(){};Va.prototype.insert=function(t,e){},Va.prototype.remove=function(t,e){},Va.prototype.query=function(){},Va.prototype.interfaces_=function(){return[]},Va.prototype.getClass=function(){return Va};var qa=function(){if(this._childBoundables=new Jo,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ya={serialVersionUID:{configurable:!0}};qa.prototype.getLevel=function(){return this._level},qa.prototype.size=function(){return this._childBoundables.size()},qa.prototype.getChildBoundables=function(){return this._childBoundables},qa.prototype.addChildBoundable=function(t){Do.isTrue(null===this._bounds),this._childBoundables.add(t)},qa.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},qa.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},qa.prototype.interfaces_=function(){return[Ga,Wi]},qa.prototype.getClass=function(){return qa},Ya.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(qa,Ya);var ja=function(){};ja.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},ja.min=function(t){return ja.sort(t),t.get(0)},ja.sort=function(t,e){var n=t.toArray();e?ws.sort(n,e):ws.sort(n);for(var r=t.iterator(),A=0,i=n.length;A<i;A++)r.next(),r.set(n[A])},ja.singletonList=function(t){var e=new Jo;return e.add(t),e};var Ha=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()};Ha.prototype.expandToQueue=function(t,e){var n=Ha.isComposite(this._boundable1),r=Ha.isComposite(this._boundable2);if(n&&r)return Ha.area(this._boundable1)>Ha.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 qi("neither boundable is composite")},Ha.prototype.isLeaves=function(){return!(Ha.isComposite(this._boundable1)||Ha.isComposite(this._boundable2))},Ha.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Ha.prototype.expand=function(t,e,n,r){for(var A=t.getChildBoundables().iterator();A.hasNext();){var i=A.next(),o=new Ha(i,e,this._itemDistance);o.getDistance()<r&&n.add(o)}},Ha.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},Ha.prototype.getDistance=function(){return this._distance},Ha.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ha.prototype.interfaces_=function(){return[Hi]},Ha.prototype.getClass=function(){return Ha},Ha.area=function(t){return t.getBounds().getArea()},Ha.isComposite=function(t){return t instanceof qa};var Xa=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Jo,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];Do.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},$a={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Xa.prototype.getNodeCapacity=function(){return this._nodeCapacity},Xa.prototype.lastNode=function(t){return t.get(t.size()-1)},Xa.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 qa?t+=this.size(n):n instanceof Ua&&(t+=1)}return t}},Xa.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var A=r.next();A instanceof Ua&&A.getItem()===e&&(n=A)}return null!==n&&(t.getChildBoundables().remove(n),!0)},Xa.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Jo:t}if(1===arguments.length){for(var e=arguments[0],n=new Jo,r=e.getChildBoundables().iterator();r.hasNext();){var A=r.next();if(A instanceof qa){var i=this.itemsTree(A);null!==i&&n.add(i)}else A instanceof Ua?n.add(A.getItem()):Do.shouldNeverReachHere()}return n.size()<=0?null:n}},Xa.prototype.insert=function(t,e){Do.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ua(t,e))},Xa.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Jo;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];if(Do.isTrue(n>-2),r.getLevel()===n)return A.add(r),null;for(var i=r.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof qa?this.boundablesAtLevel(n,o,A):(Do.isTrue(o instanceof Ua),-1===n&&A.add(o))}return null}},Xa.prototype.query=function(){var t=this;if(1===arguments.length){var e=arguments[0];this.build();var n=new Jo;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}if(2===arguments.length){var r=arguments[0],A=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,A)}else if(3===arguments.length)if(ro(arguments[2],za)&&arguments[0]instanceof Object&&arguments[1]instanceof qa)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);t.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof qa?t.query(i,u,o):u instanceof Ua?o.visitItem(u.getItem()):Do.shouldNeverReachHere())}else if(ro(arguments[2],Ko)&&arguments[0]instanceof Object&&arguments[1]instanceof qa)for(var c=arguments[0],l=arguments[2],f=arguments[1].getChildBoundables(),h=0;h<f.size();h++){var p=f.get(h);t.getIntersectsOp().intersects(p.getBounds(),c)&&(p instanceof qa?t.query(c,p,l):p instanceof Ua?l.add(p.getItem()):Do.shouldNeverReachHere())}},Xa.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},Xa.prototype.getRoot=function(){return this.build(),this._root},Xa.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],A=arguments[2],i=this.removeItem(r,A);if(i)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 qa&&(i=this.remove(n,a,A)))){o=a;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),i}},Xa.prototype.createHigherLevels=function(t,e){Do.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},Xa.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 qa){var r=this.depth(n);r>t&&(t=r)}}return t+1}},Xa.prototype.createParentBoundables=function(t,e){var n=this;Do.isTrue(!t.isEmpty());var r=new Jo;r.add(this.createNode(e));var A=new Jo(t);ja.sort(A,this.getComparator());for(var i=A.iterator();i.hasNext();){var o=i.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(o)}return r},Xa.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Xa.prototype.interfaces_=function(){return[Wi]},Xa.prototype.getClass=function(){return Xa},Xa.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},$a.IntersectsOp.get=function(){return Wa},$a.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},$a.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Xa,$a);var Wa=function(){},Ka=function(){};Ka.prototype.distance=function(t,e){},Ka.prototype.interfaces_=function(){return[]},Ka.prototype.getClass=function(){return Ka};var Za=function(t){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,t.call(this,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(t,e){Do.isTrue(t.length>0);for(var n=new Jo,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},e.prototype.createNode=function(t){return new Ja(t)},e.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.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)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),A=t.iterator(),i=0;i<e;i++){r[i]=new Jo;for(var o=0;A.hasNext()&&o<n;){var s=A.next();r[i].add(s),o++}}return r},e.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(ro(arguments[2],za)&&arguments[0]instanceof Object&&arguments[1]instanceof qa){var A=arguments[0],i=arguments[1],o=arguments[2];t.prototype.query.call(this,A,i,o)}else if(ro(arguments[2],Ko)&&arguments[0]instanceof Object&&arguments[1]instanceof qa){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},e.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)},e.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(t,n){Do.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),A=new Jo(t);ja.sort(A,e.xComparator);var i=this.verticalSlices(A,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(i,n)},e.prototype.nearestNeighbour=function(){if(1===arguments.length){if(ro(arguments[0],Ka)){var t=arguments[0],n=new Ha(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(n)}if(arguments[0]instanceof Ha){var r=arguments[0];return this.nearestNeighbour(r,Yi.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof e&&ro(arguments[1],Ka)){var A=arguments[0],i=arguments[1],o=new Ha(this.getRoot(),A.getRoot(),i);return this.nearestNeighbour(o)}if(arguments[0]instanceof Ha&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,c=new Qa;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 Ua(arguments[0],arguments[1]),d=new Ha(this.getRoot(),p,h);return this.nearestNeighbour(d)[0]}},e.prototype.interfaces_=function(){return[Va,Wi]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return Ja},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[$i]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[$i]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(Xa),Ja=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 vo(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qa),tu=function(){};tu.prototype.interfaces_=function(){return[]},tu.prototype.getClass=function(){return tu},tu.relativeSign=function(t,e){return t<e?-1:t>e?1:0},tu.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=tu.relativeSign(e.x,n.x),A=tu.relativeSign(e.y,n.y);switch(t){case 0:return tu.compareValue(r,A);case 1:return tu.compareValue(A,r);case 2:return tu.compareValue(A,-r);case 3:return tu.compareValue(-r,A);case 4:return tu.compareValue(-r,-A);case 5:return tu.compareValue(-A,-r);case 6:return tu.compareValue(-A,r);case 7:return tu.compareValue(r,-A)}return Do.shouldNeverReachHere("invalid octant value"),0},tu.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var eu=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 Ki(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};eu.prototype.getCoordinate=function(){return this.coord},eu.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},eu.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:tu.compare(this._segmentOctant,this.coord,e.coord)},eu.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},eu.prototype.isInterior=function(){return this._isInterior},eu.prototype.interfaces_=function(){return[Hi]},eu.prototype.getClass=function(){return eu};var nu=function(){this._nodeMap=new ys,this._edge=null;var t=arguments[0];this._edge=t};nu.prototype.getSplitCoordinates=function(){var t=new es;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()},nu.prototype.addCollapsedNodes=function(){var t=new Jo;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)}},nu.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},nu.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 so(e+1))}},nu.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);n.add(new Ki(t.coord),!1);for(var i=t.segmentIndex+1;i<=e.segmentIndex;i++)n.add(this._edge.getCoordinate(i));A&&n.add(new Ki(e.coord))},nu.prototype.iterator=function(){return this._nodeMap.values().iterator()},nu.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},nu.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)},nu.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var A=n.next();this.findCollapseIndex(r,A,e)&&t.add(new so(e[0])),r=A}},nu.prototype.getEdge=function(){return this._edge},nu.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},nu.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new Ki(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this._edge.getCoordinate(s);return A&&(i[o]=new Ki(e.coord)),new ou(i,this._edge.getData())},nu.prototype.add=function(t,e){var n=new eu(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(Do.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},nu.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new No("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),A=r[r.length-1];if(!A.equals2D(e[e.length-1]))throw new No("bad split edge end point at "+A)},nu.prototype.interfaces_=function(){return[]},nu.prototype.getClass=function(){return nu};var ru=function(){};ru.prototype.interfaces_=function(){return[]},ru.prototype.getClass=function(){return ru},ru.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 qi("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 Ki&&arguments[1]instanceof Ki){var A=arguments[0],i=arguments[1],o=i.x-A.x,s=i.y-A.y;if(0===o&&0===s)throw new qi("Cannot compute the octant for two identical points "+A);return ru.octant(o,s)}};var Au=function(){};Au.prototype.getCoordinates=function(){},Au.prototype.size=function(){},Au.prototype.getCoordinate=function(t){},Au.prototype.isClosed=function(){},Au.prototype.setData=function(t){},Au.prototype.getData=function(){},Au.prototype.interfaces_=function(){return[]},Au.prototype.getClass=function(){return Au};var iu=function(){};iu.prototype.addIntersection=function(t,e){},iu.prototype.interfaces_=function(){return[Au]},iu.prototype.getClass=function(){return iu};var ou=function(){this._nodeList=new nu(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};ou.prototype.getCoordinates=function(){return this._pts},ou.prototype.size=function(){return this._pts.length},ou.prototype.getCoordinate=function(t){return this._pts[t]},ou.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},ou.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},ou.prototype.setData=function(t){this._data=t},ou.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ru.octant(t,e)},ou.prototype.getData=function(){return this._data},ou.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],A=new Ki(arguments[0].getIntersection(r));this.addIntersection(A,n)}},ou.prototype.toString=function(){return xo.toLineString(new Js(this._pts))},ou.prototype.getNodeList=function(){return this._nodeList},ou.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var A=this._pts[r];t.equals2D(A)&&(n=r)}return this._nodeList.add(t,n)},ou.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},ou.prototype.interfaces_=function(){return[iu]},ou.prototype.getClass=function(){return ou},ou.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Jo;return ou.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 su=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new Ki,this.p1=new Ki;else if(1===arguments.length){var t=arguments[0];this.p0=new Ki(t.p0),this.p1=new Ki(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],A=arguments[3];this.p0=new Ki(e,n),this.p1=new Ki(r,A)}},au={serialVersionUID:{configurable:!0}};su.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},su.prototype.orientationIndex=function(){if(arguments[0]instanceof su){var t=arguments[0],e=Po.orientationIndex(this.p0,this.p1,t.p0),n=Po.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 Ki){var r=arguments[0];return Po.orientationIndex(this.p0,this.p1,r)}},su.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},su.prototype.isVertical=function(){return this.p0.x===this.p1.x},su.prototype.equals=function(t){if(!(t instanceof su))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},su.prototype.intersection=function(t){var e=new Mo;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},su.prototype.project=function(){if(arguments[0]instanceof Ki){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Ki(t);var e=this.projectionFactor(t),n=new Ki;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 su){var r=arguments[0],A=this.projectionFactor(r.p0),i=this.projectionFactor(r.p1);if(A>=1&&i>=1)return null;if(A<=0&&i<=0)return null;var o=this.project(r.p0);A<0&&(o=this.p0),A>1&&(o=this.p1);var s=this.project(r.p1);return i<0&&(s=this.p0),i>1&&(s=this.p1),new su(o,s)}},su.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},su.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},su.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},su.prototype.distancePerpendicular=function(t){return Po.distancePointLinePerpendicular(t,this.p0,this.p1)},su.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},su.prototype.midPoint=function(){return su.midPoint(this.p0,this.p1)},su.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?Yi.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},su.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=Yi.MAX_VALUE,A=null,i=this.closestPoint(t.p0);r=i.distance(t.p0),n[0]=i,n[1]=t.p0;var o=this.closestPoint(t.p1);(A=o.distance(t.p1))<r&&(r=A,n[0]=o,n[1]=t.p1);var s=t.closestPoint(this.p0);(A=s.distance(this.p0))<r&&(r=A,n[0]=this.p0,n[1]=s);var a=t.closestPoint(this.p1);return(A=a.distance(this.p1))<r&&(r=A,n[0]=this.p1,n[1]=a),n},su.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},su.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},su.prototype.getLength=function(){return this.p0.distance(this.p1)},su.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},su.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},su.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)},su.prototype.lineIntersection=function(t){try{return mo.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof yo))throw t}return null},su.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},su.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),A=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,o=Math.sqrt(A*A+i*i),s=0,a=0;if(0!==e){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*A/o,a=e*i/o}return new Ki(n-a,r+s)},su.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}},su.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Yi.isNaN(e))&&(e=1),e},su.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},su.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},su.prototype.distance=function(){if(arguments[0]instanceof su){var t=arguments[0];return Po.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof Ki){var e=arguments[0];return Po.distancePointLine(e,this.p0,this.p1)}},su.prototype.pointAlong=function(t){var e=new Ki;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},su.prototype.hashCode=function(){var t=Yi.doubleToLongBits(this.p0.x);t^=31*Yi.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=Yi.doubleToLongBits(this.p1.x);return n^=31*Yi.doubleToLongBits(this.p1.y),e^(Math.trunc(n)^Math.trunc(n>>32))},su.prototype.interfaces_=function(){return[Hi,Wi]},su.prototype.getClass=function(){return su},su.midPoint=function(t,e){return new Ki((t.x+e.x)/2,(t.y+e.y)/2)},au.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(su,au);var uu=function(){this.tempEnv1=new vo,this.tempEnv2=new vo,this._overlapSeg1=new su,this._overlapSeg2=new su};uu.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)}},uu.prototype.interfaces_=function(){return[]},uu.prototype.getClass=function(){return uu};var cu=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};cu.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},cu.prototype.computeSelect=function(t,e,n,r){var A=this._pts[e],i=this._pts[n];if(r.tempEnv1.init(A,i),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)},cu.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},cu.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},cu.prototype.setId=function(t){this._id=t},cu.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},cu.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new vo(t,e)}return this._env},cu.prototype.getEndIndex=function(){return this._end},cu.prototype.getStartIndex=function(){return this._start},cu.prototype.getContext=function(){return this._context},cu.prototype.getId=function(){return this._id},cu.prototype.computeOverlapsInternal=function(t,e,n,r,A,i){var o=this._pts[t],s=this._pts[e],a=n._pts[r],u=n._pts[A];if(e-t==1&&A-r==1)return i.overlap(this,t,n,r),null;if(i.tempEnv1.init(o,s),i.tempEnv2.init(a,u),!i.tempEnv1.intersects(i.tempEnv2))return null;var c=Math.trunc((t+e)/2),l=Math.trunc((r+A)/2);t<c&&(r<l&&this.computeOverlapsInternal(t,c,n,r,l,i),l<A&&this.computeOverlapsInternal(t,c,n,l,A,i)),c<e&&(r<l&&this.computeOverlapsInternal(c,e,n,r,l,i),l<A&&this.computeOverlapsInternal(c,e,n,l,A,i))},cu.prototype.interfaces_=function(){return[]},cu.prototype.getClass=function(){return cu};var lu=function(){};lu.prototype.interfaces_=function(){return[]},lu.prototype.getClass=function(){return lu},lu.getChainStartIndices=function(t){var e=0,n=new Jo;n.add(new so(e));do{var r=lu.findChainEnd(t,e);n.add(new so(r)),e=r}while(e<t.length-1);return lu.toIntArray(n)},lu.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=Ma.quadrant(t[n],t[n+1]),A=e+1;A<t.length;){if(!t[A-1].equals2D(t[A]))if(Ma.quadrant(t[A-1],t[A])!==r)break;A++}return A-1},lu.getChains=function(){if(1===arguments.length)return lu.getChains(arguments[0],null);if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=new Jo,r=lu.getChainStartIndices(t),A=0;A<r.length-1;A++){var i=new cu(t,r[A],r[A+1],e);n.add(i)}return n}},lu.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 fu=function(){};fu.prototype.computeNodes=function(t){},fu.prototype.getNodedSubstrings=function(){},fu.prototype.interfaces_=function(){return[]},fu.prototype.getClass=function(){return fu};var hu=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};hu.prototype.setSegmentIntersector=function(t){this._segInt=t},hu.prototype.interfaces_=function(){return[fu]},hu.prototype.getClass=function(){return hu};var pu=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Jo,this._index=new Za,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return ou.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=this,n=lu.getChains(t.getCoordinates(),t).iterator();n.hasNext();){var r=n.next();r.setId(e._idCounter++),e._index.insert(r.getEnvelope(),r),e._monoChains.add(r)}},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=this,e=new du(this._segInt),n=this._monoChains.iterator();n.hasNext();)for(var r=n.next(),A=t._index.query(r.getEnvelope()).iterator();A.hasNext();){var i=A.next();if(i.getId()>r.getId()&&(r.computeOverlaps(i,e),t._nOverlaps++),t._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return du},Object.defineProperties(e,n),e}(hu),du=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],A=arguments[0].getContext(),i=n.getContext();this._si.processIntersections(A,e,i,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(uu),gu=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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(A),this.setEndCapStyle(i),this.setJoinStyle(o),this.setMitreLimit(s)}},yu={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}};gu.prototype.getEndCapStyle=function(){return this._endCapStyle},gu.prototype.isSingleSided=function(){return this._isSingleSided},gu.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=gu.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=gu.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==gu.JOIN_ROUND&&(this._quadrantSegments=gu.DEFAULT_QUADRANT_SEGMENTS)},gu.prototype.getJoinStyle=function(){return this._joinStyle},gu.prototype.setJoinStyle=function(t){this._joinStyle=t},gu.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},gu.prototype.getSimplifyFactor=function(){return this._simplifyFactor},gu.prototype.getQuadrantSegments=function(){return this._quadrantSegments},gu.prototype.setEndCapStyle=function(t){this._endCapStyle=t},gu.prototype.getMitreLimit=function(){return this._mitreLimit},gu.prototype.setMitreLimit=function(t){this._mitreLimit=t},gu.prototype.setSingleSided=function(t){this._isSingleSided=t},gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu},gu.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},yu.CAP_ROUND.get=function(){return 1},yu.CAP_FLAT.get=function(){return 2},yu.CAP_SQUARE.get=function(){return 3},yu.JOIN_ROUND.get=function(){return 1},yu.JOIN_MITRE.get=function(){return 2},yu.JOIN_BEVEL.get=function(){return 3},yu.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},yu.DEFAULT_MITRE_LIMIT.get=function(){return 5},yu.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(gu,yu);var _u=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Po.COUNTERCLOCKWISE,this._inputLine=t||null},mu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};_u.prototype.isDeletable=function(t,e,n,r){var A=this._inputLine[t],i=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(A,i,o)&&(!!this.isShallow(A,i,o,r)&&this.isShallowSampled(A,i,t,n,r))},_u.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),A=!1;r<this._inputLine.length;){var i=!1;t.isDeletable(e,n,r,t._distanceTol)&&(t._isDeleted[n]=_u.DELETE,i=!0,A=!0),e=i?r:n,n=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(n)}return A},_u.prototype.isShallowConcavity=function(t,e,n,r){return Po.computeOrientation(t,e,n)===this._angleOrientation&&Po.distancePointLine(e,t,n)<r},_u.prototype.isShallowSampled=function(t,e,n,r,A){var i=Math.trunc((r-n)/_u.NUM_PTS_TO_CHECK);i<=0&&(i=1);for(var o=n;o<r;o+=i)if(!this.isShallow(t,e,this._inputLine[o],A))return!1;return!0},_u.prototype.isConcave=function(t,e,n){var r=Po.computeOrientation(t,e,n)===this._angleOrientation;return r},_u.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=Po.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},_u.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===_u.DELETE;)e++;return e},_u.prototype.isShallow=function(t,e,n,r){return Po.distancePointLine(e,t,n)<r},_u.prototype.collapseLine=function(){for(var t=new es,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==_u.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},_u.prototype.interfaces_=function(){return[]},_u.prototype.getClass=function(){return _u},_u.simplify=function(t,e){return new _u(t).simplify(e)},mu.INIT.get=function(){return 0},mu.DELETE.get=function(){return 1},mu.KEEP.get=function(){return 1},mu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(_u,mu);var vu=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Jo},Eu={COORDINATE_ARRAY_TYPE:{configurable:!0}};vu.prototype.getCoordinates=function(){return this._ptList.toArray(vu.COORDINATE_ARRAY_TYPE)},vu.prototype.setPrecisionModel=function(t){this._precisionModel=t},vu.prototype.addPt=function(t){var e=new Ki(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},vu.prototype.revere=function(){},vu.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])},vu.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},vu.prototype.toString=function(){return(new aa).createLineString(this.getCoordinates()).toString()},vu.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new Ki(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},vu.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu},Eu.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(vu,Eu);var wu=function(){},bu={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};wu.prototype.interfaces_=function(){return[]},wu.prototype.getClass=function(){return wu},wu.toDegrees=function(t){return 180*t/Math.PI},wu.normalize=function(t){for(;t>Math.PI;)t-=wu.PI_TIMES_2;for(;t<=-Math.PI;)t+=wu.PI_TIMES_2;return t},wu.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,A=n.y-e.y;return Math.atan2(A,r)}},wu.isAcute=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)>0},wu.isObtuse=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)<0},wu.interiorAngle=function(t,e,n){var r=wu.angle(e,t),A=wu.angle(e,n);return Math.abs(A-r)},wu.normalizePositive=function(t){if(t<0){for(;t<0;)t+=wu.PI_TIMES_2;t>=wu.PI_TIMES_2&&(t=0)}else{for(;t>=wu.PI_TIMES_2;)t-=wu.PI_TIMES_2;t<0&&(t=0)}return t},wu.angleBetween=function(t,e,n){var r=wu.angle(e,t),A=wu.angle(e,n);return wu.diff(r,A)},wu.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},wu.toRadians=function(t){return t*Math.PI/180},wu.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?wu.COUNTERCLOCKWISE:n<0?wu.CLOCKWISE:wu.NONE},wu.angleBetweenOriented=function(t,e,n){var r=wu.angle(e,t),A=wu.angle(e,n)-r;return A<=-Math.PI?A+wu.PI_TIMES_2:A>Math.PI?A-wu.PI_TIMES_2:A},bu.PI_TIMES_2.get=function(){return 2*Math.PI},bu.PI_OVER_2.get=function(){return Math.PI/2},bu.PI_OVER_4.get=function(){return Math.PI/4},bu.COUNTERCLOCKWISE.get=function(){return Po.COUNTERCLOCKWISE},bu.CLOCKWISE.get=function(){return Po.CLOCKWISE},bu.NONE.get=function(){return Po.COLLINEAR},Object.defineProperties(wu,bu);var Iu=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 su,this._seg1=new su,this._offset0=new su,this._offset1=new su,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 Mo,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===gu.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Cu={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}};Iu.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=Po.computeOrientation(this._s0,this._s1,this._s2),r=n===Po.CLOCKWISE&&this._side===ga.LEFT||n===Po.COUNTERCLOCKWISE&&this._side===ga.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Iu.prototype.addLineEndCap=function(t,e){var n=new su(t,e),r=new su;this.computeOffsetSegment(n,ga.LEFT,this._distance,r);var A=new su;this.computeOffsetSegment(n,ga.RIGHT,this._distance,A);var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i);switch(this._bufParams.getEndCapStyle()){case gu.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,Po.CLOCKWISE,this._distance),this._segList.addPt(A.p1);break;case gu.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(A.p1);break;case gu.CAP_SQUARE:var a=new Ki;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new Ki(r.p1.x+a.x,r.p1.y+a.y),c=new Ki(A.p1.x+a.x,A.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(c)}},Iu.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Iu.prototype.addMitreJoin=function(t,e,n,r){var A=!0,i=null;try{i=mo.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:i.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(A=!1)}catch(t){if(!(t instanceof yo))throw t;i=new Ki(0,0),A=!1}A?this._segList.addPt(i):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Iu.prototype.addFilletCorner=function(t,e,n,r,A){var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i),a=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,a);r===Po.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,A),this._segList.addPt(n)},Iu.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Iu.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===gu.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===gu.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))},Iu.prototype.createSquare=function(t){this._segList.addPt(new Ki(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new Ki(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new Ki(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new Ki(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Iu.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Iu.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Iu.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Iu.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)},Iu.prototype.addLimitedMitreJoin=function(t,e,n,r){var A=this._seg0.p1,i=wu.angle(A,this._seg0.p0),o=wu.angleBetweenOriented(this._seg0.p0,A,this._seg1.p1)/2,s=wu.normalize(i+o),a=wu.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(o)),l=A.x+u*Math.cos(a),f=A.y+u*Math.sin(a),h=new Ki(l,f),p=new su(A,h),d=p.pointAlongOffset(1,c),g=p.pointAlongOffset(1,-c);this._side===ga.LEFT?(this._segList.addPt(d),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(d))},Iu.prototype.computeOffsetSegment=function(t,e,n,r){var A=e===ga.LEFT?1:-1,i=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,s=Math.sqrt(i*i+o*o),a=A*n*i/s,u=A*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},Iu.prototype.addFilletArc=function(t,e,n,r,A){var i=r===Po.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 Ki;u<o;){var l=e+i*u;c.x=t.x+A*Math.cos(l),c.y=t.y+A*Math.sin(l),this._segList.addPt(c),u+=a}},Iu.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*Iu.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 Ki((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 Ki((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)}},Iu.prototype.createCircle=function(t){var e=new Ki(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Iu.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Iu.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new vu,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Iu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Iu.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===gu.JOIN_BEVEL||this._bufParams.getJoinStyle()===gu.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,Po.CLOCKWISE,this._distance))},Iu.prototype.closeRing=function(){this._segList.closeRing()},Iu.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Iu.prototype.interfaces_=function(){return[]},Iu.prototype.getClass=function(){return Iu},Cu.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Cu.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Cu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Cu.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Iu,Cu);var xu=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};xu.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),A=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],A):this.computeOffsetCurve(t,n,A);var i=A.getCoordinates();return n&&ns.reverse(i),i},xu.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var A=_u.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],ga.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{n.addSegments(t,!1);var s=_u.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],ga.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},xu.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===ga.RIGHT&&(r=-r);var A=_u.simplify(t,r),i=A.length-1;n.initSideSegments(A[i-1],A[0],e);for(var o=1;o<=i;o++){var s=1!==o;n.addNextSegment(A[o],s)}n.closeRing()},xu.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=_u.simplify(t,n),A=r.length-1;e.initSideSegments(r[0],r[1],ga.LEFT);for(var i=2;i<=A;i++)e.addNextSegment(r[i],!0);e.addLastSegment(),e.addLineEndCap(r[A-1],r[A]);var o=_u.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],ga.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},xu.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case gu.CAP_ROUND:e.createCircle(t);break;case gu.CAP_SQUARE:e.createSquare(t)}},xu.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 A=e<0;this.computeSingleSidedBufferCurve(t,A,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},xu.prototype.getBufferParameters=function(){return this._bufParams},xu.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},xu.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return xu.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},xu.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var A=_u.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],ga.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{var s=_u.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],ga.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},xu.prototype.getSegGen=function(t){return new Iu(this._precisionModel,this._bufParams,t)},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu},xu.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new Ki(t[n]);return e};var Nu=function(){this._subgraphs=null,this._seg=new su,this._cga=new Po;var t=arguments[0];this._subgraphs=t},Su={DepthSegment:{configurable:!0}};Nu.prototype.findStabbedSegments=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],n=new Jo,r=this._subgraphs.iterator();r.hasNext();){var A=r.next(),i=A.getEnvelope();e.y<i.getMinY()||e.y>i.getMaxY()||t.findStabbedSegments(e,A.getDirectedEdges(),n)}return n}if(3===arguments.length)if(ro(arguments[2],Ko)&&arguments[0]instanceof Ki&&arguments[1]instanceof Pa)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++){if(t._seg.p0=u[c],t._seg.p1=u[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse(),!(Math.max(t._seg.p0.x,t._seg.p1.x)<o.x||t._seg.isHorizontal()||o.y<t._seg.p0.y||o.y>t._seg.p1.y||Po.computeOrientation(t._seg.p0,t._seg.p1,o)===Po.RIGHT)){var l=s.getDepth(ga.LEFT);t._seg.p0.equals(u[c])||(l=s.getDepth(ga.RIGHT));var f=new Du(t._seg,l);a.add(f)}}else if(ro(arguments[2],Ko)&&arguments[0]instanceof Ki&&ro(arguments[1],Ko))for(var h=arguments[0],p=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&t.findStabbedSegments(h,g,p)}},Nu.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:ja.min(e)._leftDepth},Nu.prototype.interfaces_=function(){return[]},Nu.prototype.getClass=function(){return Nu},Su.DepthSegment.get=function(){return Du},Object.defineProperties(Nu,Su);var Du=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new su(t),this._leftDepth=e};Du.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)},Du.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Du.prototype.toString=function(){return this._upwardSeg.toString()},Du.prototype.interfaces_=function(){return[Hi]},Du.prototype.getClass=function(){return Du};var Lu=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Lu.prototype.area=function(){return Lu.area(this.p0,this.p1,this.p2)},Lu.prototype.signedArea=function(){return Lu.signedArea(this.p0,this.p1,this.p2)},Lu.prototype.interpolateZ=function(t){if(null===t)throw new qi("Supplied point is null.");return Lu.interpolateZ(t,this.p0,this.p1,this.p2)},Lu.prototype.longestSideLength=function(){return Lu.longestSideLength(this.p0,this.p1,this.p2)},Lu.prototype.isAcute=function(){return Lu.isAcute(this.p0,this.p1,this.p2)},Lu.prototype.circumcentre=function(){return Lu.circumcentre(this.p0,this.p1,this.p2)},Lu.prototype.area3D=function(){return Lu.area3D(this.p0,this.p1,this.p2)},Lu.prototype.centroid=function(){return Lu.centroid(this.p0,this.p1,this.p2)},Lu.prototype.inCentre=function(){return Lu.inCentre(this.p0,this.p1,this.p2)},Lu.prototype.interfaces_=function(){return[]},Lu.prototype.getClass=function(){return Lu},Lu.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)},Lu.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Lu.det=function(t,e,n,r){return t*r-e*n},Lu.interpolateZ=function(t,e,n,r){var A=e.x,i=e.y,o=n.x-A,s=r.x-A,a=n.y-i,u=r.y-i,c=o*u-s*a,l=t.x-A,f=t.y-i,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)},Lu.longestSideLength=function(t,e,n){var r=t.distance(e),A=e.distance(n),i=n.distance(t),o=r;return A>o&&(o=A),i>o&&(o=i),o},Lu.isAcute=function(t,e,n){return!!wu.isAcute(t,e,n)&&(!!wu.isAcute(e,n,t)&&!!wu.isAcute(n,t,e))},Lu.circumcentre=function(t,e,n){var r=n.x,A=n.y,i=t.x-r,o=t.y-A,s=e.x-r,a=e.y-A,u=2*Lu.det(i,o,s,a),c=Lu.det(o,i*i+o*o,a,s*s+a*a),l=Lu.det(i,i*i+o*o,s,s*s+a*a);return new Ki(r-c/u,A+l/u)},Lu.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,A=new mo(t.x+n/2,t.y+r/2,1),i=new mo(t.x-r+n/2,t.y+n+r/2,1);return new mo(A,i)},Lu.angleBisector=function(t,e,n){var r=e.distance(t),A=r/(r+e.distance(n)),i=n.x-t.x,o=n.y-t.y;return new Ki(t.x+A*i,t.y+A*o)},Lu.area3D=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=e.z-t.z,o=n.x-t.x,s=n.y-t.y,a=n.z-t.z,u=A*a-i*s,c=i*o-r*a,l=r*s-A*o,f=u*u+c*c+l*l,h=Math.sqrt(f)/2;return h},Lu.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,A=(t.y+e.y+n.y)/3;return new Ki(r,A)},Lu.inCentre=function(t,e,n){var r=e.distance(n),A=t.distance(n),i=t.distance(e),o=r+A+i,s=(r*t.x+A*e.x+i*n.x)/o,a=(r*t.y+A*e.y+i*n.y)/o;return new Ki(s,a)};var Tu=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Jo;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Tu.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,eo.EXTERIOR,eo.INTERIOR)},Tu.prototype.addPolygon=function(t){var e=this,n=this._distance,r=ga.LEFT;this._distance<0&&(n=-this._distance,r=ga.RIGHT);var A=t.getExteriorRing(),i=ns.removeRepeatedPoints(A.getCoordinates());if(this._distance<0&&this.isErodedCompletely(A,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,n,r,eo.EXTERIOR,eo.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=ns.removeRepeatedPoints(s.getCoordinates());e._distance>0&&e.isErodedCompletely(s,-e._distance)||e.addPolygonRing(a,n,ga.opposite(r),eo.INTERIOR,eo.EXTERIOR)}},Tu.prototype.isTriangleErodedCompletely=function(t,e){var n=new Lu(t[0],t[1],t[2]),r=n.inCentre();return Po.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Tu.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=ns.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,eo.EXTERIOR,eo.INTERIOR)},Tu.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new ou(t,new Ca(0,eo.BOUNDARY,e,n));this._curveList.add(r)},Tu.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Tu.prototype.addPolygonRing=function(t,e,n,r,A){if(0===e&&t.length<js.MINIMUM_VALID_SIZE)return null;var i=r,o=A;t.length>=js.MINIMUM_VALID_SIZE&&Po.isCCW(t)&&(i=A,o=r,n=ga.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,i,o)},Tu.prototype.add=function(t){if(t.isEmpty())return null;t instanceof qs?this.addPolygon(t):t instanceof Us?this.addLineString(t):t instanceof zs?this.addPoint(t):(t instanceof Ys||t instanceof Ss||t instanceof Hs||t instanceof Ns)&&this.addCollection(t)},Tu.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(),A=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>A},Tu.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Tu.prototype.interfaces_=function(){return[]},Tu.prototype.getClass=function(){return Tu};var Mu=function(){};Mu.prototype.locate=function(t){},Mu.prototype.interfaces_=function(){return[]},Mu.prototype.getClass=function(){return Mu};var Ou=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()};Ou.prototype.next=function(){if(this._atStart)return this._atStart=!1,Ou.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 Zo;var t=this._parent.getGeometryN(this._index++);return t instanceof Ns?(this._subcollectionIterator=new Ou(t),this._subcollectionIterator.next()):t},Ou.prototype.remove=function(){throw new Error(this.getClass().getName())},Ou.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)},Ou.prototype.interfaces_=function(){return[Wo]},Ou.prototype.getClass=function(){return Ou},Ou.isAtomic=function(t){return!(t instanceof Ns)};var Ru=function(){this._geom=null;var t=arguments[0];this._geom=t};Ru.prototype.locate=function(t){return Ru.locate(t,this._geom)},Ru.prototype.interfaces_=function(){return[Mu]},Ru.prototype.getClass=function(){return Ru},Ru.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Po.isPointInRing(t,e.getCoordinates())},Ru.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Ru.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var A=e.getInteriorRingN(r);if(Ru.isPointInRing(t,A))return!1}return!0},Ru.containsPoint=function(t,e){if(e instanceof qs)return Ru.containsPointInPolygon(t,e);if(e instanceof Ns)for(var n=new Ou(e);n.hasNext();){var r=n.next();if(r!==e&&Ru.containsPoint(t,r))return!0}return!1},Ru.locate=function(t,e){return e.isEmpty()?eo.EXTERIOR:Ru.containsPoint(t,e)?eo.INTERIOR:eo.EXTERIOR};var Pu=function(){this._edgeMap=new ys,this._edgeList=null,this._ptInAreaLocation=[eo.NONE,eo.NONE]};Pu.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)},Pu.prototype.propagateSideLabels=function(t){for(var e=eo.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,ga.LEFT)!==eo.NONE&&(e=r.getLocation(t,ga.LEFT))}if(e===eo.NONE)return null;for(var A=e,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();if(s.getLocation(t,ga.ON)===eo.NONE&&s.setLocation(t,ga.ON,A),s.isArea(t)){var a=s.getLocation(t,ga.LEFT),u=s.getLocation(t,ga.RIGHT);if(u!==eo.NONE){if(u!==A)throw new Ea("side location conflict",o.getCoordinate());a===eo.NONE&&Do.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),A=a}else Do.isTrue(s.getLocation(t,ga.LEFT)===eo.NONE,"found single null side"),s.setLocation(t,ga.RIGHT,A),s.setLocation(t,ga.LEFT,A)}}},Pu.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Pu.prototype.print=function(t){_o.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Pu.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Pu.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,ga.LEFT);Do.isTrue(r!==eo.NONE,"Found unlabelled area edge");for(var A=r,i=this.iterator();i.hasNext();){var o=i.next().getLabel();Do.isTrue(o.isArea(t),"Found non-area edge");var s=o.getLocation(t,ga.LEFT),a=o.getLocation(t,ga.RIGHT);if(s===a)return!1;if(a!==A)return!1;A=s}return!0},Pu.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},Pu.prototype.iterator=function(){return this.getEdges().iterator()},Pu.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Jo(this._edgeMap.values())),this._edgeList},Pu.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===eo.NONE&&(this._ptInAreaLocation[t]=Ru.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Pu.prototype.toString=function(){var t=new oo;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()},Pu.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){e.next().computeLabel(t)}},Pu.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(),A=0;A<2;A++)r.isLine(A)&&r.getLocation(A)===eo.BOUNDARY&&(e[A]=!0);for(var i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)if(s.isAnyNull(a)){var u=eo.NONE;if(e[a])u=eo.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(a,c,t)}s.setAllLocationsIfNull(a,u)}},Pu.prototype.getDegree=function(){return this._edgeMap.size()},Pu.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu};var ku=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(){var t=this;this.getResultAreaEdges();for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,A=0;A<this._resultAreaEdgeList.size();A++){var i=t._resultAreaEdgeList.get(A),o=i.getSym();if(i.getLabel().isArea())switch(null===e&&i.isInResult()&&(e=i),r){case t._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;n=o,r=t._LINKING_TO_OUTGOING;break;case t._LINKING_TO_OUTGOING:if(!i.isInResult())continue;n.setNext(i),r=t._SCANNING_FOR_INCOMING}}if(r===this._LINKING_TO_OUTGOING){if(null===e)throw new Ea("no outgoing dirEdge found",this.getCoordinate());Do.isTrue(e.isInResult(),"unable to link last incoming dirEdge"),n.setNext(e)}},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),A=n.getQuadrant(),i=r.getQuadrant();return Ma.isNorthern(A)&&Ma.isNorthern(i)?n:Ma.isNorthern(A)||Ma.isNorthern(i)?0!==n.getDy()?n:0!==r.getDy()?r:(Do.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){_o.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 Jo;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),A=r.getSym();null===e&&(e=A),null!==t&&A.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(ga.LEFT),r=t.getDepth(ga.RIGHT),A=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,A)!==r)throw new Ea("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var i=arguments[1],o=arguments[2],s=arguments[0];s<i;s++){var a=this._edgeList.get(s);a.setEdgeDepths(ga.RIGHT,o),o=a.getDepth(ga.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=this,n=null,r=null,A=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=e._resultAreaEdgeList.get(i),s=o.getSym();switch(null===n&&o.getEdgeRing()===t&&(n=o),A){case e._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;r=s,A=e._LINKING_TO_OUTGOING;break;case e._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),A=e._SCANNING_FOR_INCOMING}}A===this._LINKING_TO_OUTGOING&&(Do.isTrue(null!==n,"found null for first outgoing dirEdge"),Do.isTrue(n.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(n))},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,A=this.iterator();A.hasNext();){A.next().getEdgeRing()===n&&r++}return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=eo.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=eo.INTERIOR;break}if(r.isInResult()){t=eo.EXTERIOR;break}}}if(t===eo.NONE)return null;for(var A=t,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(A===eo.INTERIOR):(o.isInResult()&&(A=eo.EXTERIOR),s.isInResult()&&(A=eo.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Ca(eo.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),A=0;A<2;A++){var i=r.getLocation(A);i!==eo.INTERIOR&&i!==eo.BOUNDARY||this._label.setLocation(A,eo.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Pu),Bu=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 La(t,new ku)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ka),Fu=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Fu.prototype.compareTo=function(t){var e=t;return Fu.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Fu.prototype.interfaces_=function(){return[Hi]},Fu.prototype.getClass=function(){return Fu},Fu.orientation=function(t){return 1===ns.increasingDirection(t)},Fu.compareOriented=function(t,e,n,r){for(var A=e?1:-1,i=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+=A)===o,f=(u+=i)===s;if(l&&!f)return-1;if(!l&&f)return 1;if(l&&f)return 0}};var Gu=function(){this._edges=new Jo,this._ocaMap=new ys};Gu.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(),A=0;A<r.length;A++)A>0&&t.print(","),t.print(r[A].x+" "+r[A].y);t.println(")")}t.print(") ")},Gu.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Gu.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Gu.prototype.iterator=function(){return this._edges.iterator()},Gu.prototype.getEdges=function(){return this._edges},Gu.prototype.get=function(t){return this._edges.get(t)},Gu.prototype.findEqualEdge=function(t){var e=new Fu(t.getCoordinates());return this._ocaMap.get(e)},Gu.prototype.add=function(t){this._edges.add(t);var e=new Fu(t.getCoordinates());this._ocaMap.put(e,t)},Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu};var Uu=function(){};Uu.prototype.processIntersections=function(t,e,n,r){},Uu.prototype.isDone=function(){},Uu.prototype.interfaces_=function(){return[]},Uu.prototype.getClass=function(){return Uu};var Qu=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};Qu.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Qu.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.size()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},Qu.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Qu.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Qu.prototype.getLineIntersector=function(){return this._li},Qu.prototype.hasProperIntersection=function(){return this._hasProper},Qu.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,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)))},Qu.prototype.hasIntersection=function(){return this._hasIntersection},Qu.prototype.isDone=function(){return!1},Qu.prototype.hasInteriorIntersection=function(){return this._hasInterior},Qu.prototype.interfaces_=function(){return[Uu]},Qu.prototype.getClass=function(){return Qu},Qu.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var zu=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new Ki(t),this.segmentIndex=e,this.dist=n};zu.prototype.getSegmentIndex=function(){return this.segmentIndex},zu.prototype.getCoordinate=function(){return this.coord},zu.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},zu.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},zu.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},zu.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},zu.prototype.getDistance=function(){return this.dist},zu.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},zu.prototype.interfaces_=function(){return[Hi]},zu.prototype.getClass=function(){return zu};var Vu=function(){this._nodeMap=new ys,this.edge=null;var t=arguments[0];this.edge=t};Vu.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Vu.prototype.iterator=function(){return this._nodeMap.values().iterator()},Vu.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},Vu.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)},Vu.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],A=e.dist>0||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new Ki(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this.edge.pts[s];return A&&(i[o]=e.coord),new Xu(i,new Ca(this.edge._label))},Vu.prototype.add=function(t,e,n){var r=new zu(t,e,n),A=this._nodeMap.get(r);return null!==A?A:(this._nodeMap.put(r,r),r)},Vu.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},Vu.prototype.interfaces_=function(){return[]},Vu.prototype.getClass=function(){return Vu};var qu=function(){};qu.prototype.getChainStartIndices=function(t){var e=0,n=new Jo;n.add(new so(e));do{var r=this.findChainEnd(t,e);n.add(new so(r)),e=r}while(e<t.length-1);return qu.toIntArray(n)},qu.prototype.findChainEnd=function(t,e){for(var n=Ma.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){if(Ma.quadrant(t[r-1],t[r])!==n)break;r++}return r-1},qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu},qu.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 Yu=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new vo,this.env2=new vo;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new qu;this.startIndex=e.getChainStartIndices(this.pts)};Yu.prototype.getCoordinates=function(){return this.pts},Yu.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},Yu.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},Yu.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 A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=arguments[5],c=this.pts[A],l=this.pts[i],f=o.pts[s],h=o.pts[a];if(i-A==1&&a-s==1)return u.addIntersections(this.e,A,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((A+i)/2),d=Math.trunc((s+a)/2);A<p&&(s<d&&this.computeIntersectsForChain(A,p,o,s,d,u),d<a&&this.computeIntersectsForChain(A,p,o,d,a,u)),p<i&&(s<d&&this.computeIntersectsForChain(p,i,o,s,d,u),d<a&&this.computeIntersectsForChain(p,i,o,d,a,u))}},Yu.prototype.getStartIndexes=function(){return this.startIndex},Yu.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)},Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu};var ju=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},Hu={NULL_VALUE:{configurable:!0}};ju.prototype.getDepth=function(t,e){return this._depth[t][e]},ju.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},ju.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]!==ju.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===ju.NULL_VALUE}if(2===arguments.length){var r=arguments[0],A=arguments[1];return this._depth[r][A]===ju.NULL_VALUE}},ju.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var r=1;r<3;r++){var A=0;t._depth[e][r]>n&&(A=1),t._depth[e][r]=A}}},ju.prototype.getDelta=function(t){return this._depth[t][ga.RIGHT]-this._depth[t][ga.LEFT]},ju.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?eo.EXTERIOR:eo.INTERIOR},ju.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},ju.prototype.add=function(){var t=this;if(1===arguments.length)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var A=e.getLocation(n,r);A!==eo.EXTERIOR&&A!==eo.INTERIOR||(t.isNull(n,r)?t._depth[n][r]=ju.depthAtLocation(A):t._depth[n][r]+=ju.depthAtLocation(A))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===eo.INTERIOR&&this._depth[i][o]++}},ju.prototype.interfaces_=function(){return[]},ju.prototype.getClass=function(){return ju},ju.depthAtLocation=function(t){return t===eo.EXTERIOR?0:t===eo.INTERIOR?1:ju.NULL_VALUE},Hu.NULL_VALUE.get=function(){return-1},Object.defineProperties(ju,Hu);var Xu=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Vu(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ju,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.pts=r,this._label=A}}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,Ca.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,A=!0,i=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[--i])||(A=!1),!r&&!A)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 Yu(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new vo;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 A=new Ki(t.getIntersection(r)),i=e,o=t.getEdgeDistance(n,r),s=i+1;if(s<this.pts.length){var a=this.pts[s];A.equals2D(a)&&(i=s,o=0)}this.eiList.add(A,i,o)},e.prototype.toString=function(){var t=new oo;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,ga.ON),e.getLocation(1,ga.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,ga.LEFT),e.getLocation(1,ga.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,ga.RIGHT),e.getLocation(1,ga.RIGHT),2))},e}(Da),$u=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Gu,this._bufParams=t||null};$u.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},$u.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 Ca(t.getLabel())).flip(),n.merge(r);var A=$u.depthDelta(r),i=e.getDepthDelta()+A;e.setDepthDelta(i)}else this._edgeList.add(t),t.setDepthDelta($u.depthDelta(t.getLabel()))},$u.prototype.buildSubgraphs=function(t,e){for(var n=new Jo,r=t.iterator();r.hasNext();){var A=r.next(),i=A.getRightmostCoordinate(),o=new Nu(n).getDepth(i);A.computeDepth(o),A.findResultEdges(),n.add(A),e.add(A.getDirectedEdges(),A.getNodes())}},$u.prototype.createSubgraphs=function(t){for(var e=new Jo,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var A=new ba;A.create(r),e.add(A)}}return ja.sort(e,ja.reverseOrder()),e},$u.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},$u.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new pu,n=new Mo;return n.setPrecisionModel(t),e.setSegmentIntersector(new Qu(n)),e},$u.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new xu(n,this._bufParams),A=new Tu(t,e,r).getCurves();if(A.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(A,n),this._graph=new Ba(new Bu),this._graph.addEdges(this._edgeList.getEdges());var i=this.createSubgraphs(this._graph),o=new Fa(this._geomFact);this.buildSubgraphs(i,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},$u.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var A=r.next(),i=A.getCoordinates();if(2!==i.length||!i[0].equals2D(i[1])){var o=A.getData(),s=new Xu(A.getCoordinates(),new Ca(o));this.insertUniqueEdge(s)}}},$u.prototype.setNoder=function(t){this._workingNoder=t},$u.prototype.interfaces_=function(){return[]},$u.prototype.getClass=function(){return $u},$u.depthDelta=function(t){var e=t.getLocation(0,ga.LEFT),n=t.getLocation(0,ga.RIGHT);return e===eo.INTERIOR&&n===eo.EXTERIOR?1:e===eo.EXTERIOR&&n===eo.INTERIOR?-1:0},$u.convertSegStrings=function(t){for(var e=new aa,n=new Jo;t.hasNext();){var r=t.next(),A=e.createLineString(r.getCoordinates());n.add(A)}return e.buildGeometry(n)};var Wu=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],A=arguments[2],i=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=A,this._offsetY=i,this._isScaled=!this.isIntegerPrecision()}};Wu.prototype.rescale=function(){var t=this;if(ro(arguments[0],Xo))for(var e=arguments[0].iterator();e.hasNext();){var n=e.next();t.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){for(var r=arguments[0],A=0;A<r.length;A++)r[A].x=r[A].x/t._scaleFactor+t._offsetX,r[A].y=r[A].y/t._scaleFactor+t._offsetY;2===r.length&&r[0].equals2D(r[1])&&_o.out.println(r)}},Wu.prototype.scale=function(){var t=this;if(ro(arguments[0],Xo)){for(var e=arguments[0],n=new Jo,r=e.iterator();r.hasNext();){var A=r.next();n.add(new ou(t.scale(A.getCoordinates()),A.getData()))}return n}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new Ki(Math.round((i[s].x-t._offsetX)*t._scaleFactor),Math.round((i[s].y-t._offsetY)*t._scaleFactor),i[s].z);return ns.removeRepeatedPoints(o)}},Wu.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},Wu.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},Wu.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},Wu.prototype.interfaces_=function(){return[fu]},Wu.prototype.getClass=function(){return Wu};var Ku=function(){this._li=new Mo,this._segStrings=null;var t=arguments[0];this._segStrings=t},Zu={fact:{configurable:!0}};Ku.prototype.checkEndPtVertexIntersections=function(){var t=this;if(0===arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next().getCoordinates();t.checkEndPtVertexIntersections(n[0],t._segStrings),t.checkEndPtVertexIntersections(n[n.length-1],t._segStrings)}else if(2===arguments.length)for(var r=arguments[0],A=arguments[1].iterator();A.hasNext();)for(var i=A.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(r))throw new No("found endpt/interior pt intersection at index "+o+" :pt "+r)},Ku.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 A=arguments[0],i=arguments[1],o=A.getCoordinates(),s=i.getCoordinates(),a=0;a<o.length-1;a++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(A,a,i,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 No("found non-noded intersection at "+p+"-"+d+" and "+g+"-"+y)}},Ku.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Ku.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])},Ku.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var A=t.getIntersection(r);if(!A.equals(e)&&!A.equals(n))return!0}return!1},Ku.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new No("found non-noded collapse at "+Ku.fact.createLineString([t,e,n]))},Ku.prototype.interfaces_=function(){return[]},Ku.prototype.getClass=function(){return Ku},Zu.fact.get=function(){return new aa},Object.defineProperties(Ku,Zu);var Ju=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 qi("Scale factor must be non-zero");1!==e&&(this._pt=new Ki(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new Ki,this._p1Scaled=new Ki),this.initCorners(this._pt)},tc={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Ju.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),A=Math.min(t.y,e.y),i=Math.max(t.y,e.y),o=this._maxx<n||this._minx>r||this._maxy<A||this._miny>i;if(o)return!1;var s=this.intersectsToleranceSquare(t,e);return Do.isTrue(!(o&&s),"Found bad envelope test"),s},Ju.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new Ki(this._maxx,this._maxy),this._corner[1]=new Ki(this._minx,this._maxy),this._corner[2]=new Ki(this._minx,this._miny),this._corner[3]=new Ki(this._maxx,this._miny)},Ju.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))},Ju.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Ju.prototype.getCoordinate=function(){return this._originalPt},Ju.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Ju.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=Ju.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new vo(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Ju.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())))},Ju.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))))))},Ju.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)},Ju.prototype.interfaces_=function(){return[]},Ju.prototype.getClass=function(){return Ju},tc.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Ju,tc);var ec=function(){this.tempEnv1=new vo,this.selectedSegment=new su};ec.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)}},ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec};var nc=function(){this._index=null;var t=arguments[0];this._index=t},rc={HotPixelSnapAction:{configurable:!0}};nc.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],A=e.getSafeEnvelope(),i=new Ac(e,n,r);return this._index.query(A,{interfaces_:function(){return[za]},visitItem:function(t){t.select(A,i)}}),i.isNodeAdded()}},nc.prototype.interfaces_=function(){return[]},nc.prototype.getClass=function(){return nc},rc.HotPixelSnapAction.get=function(){return Ac},Object.defineProperties(nc,rc);var Ac=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}(ec),ic=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Jo};ic.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(A,i,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)}},ic.prototype.isDone=function(){return!1},ic.prototype.getInteriorIntersections=function(){return this._interiorIntersections},ic.prototype.interfaces_=function(){return[Uu]},ic.prototype.getClass=function(){return ic};var oc=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 Mo,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};oc.prototype.checkCorrectness=function(t){var e=ou.getNodedSubstrings(t),n=new Ku(e);try{n.checkValid()}catch(t){if(!(t instanceof go))throw t;t.printStackTrace()}},oc.prototype.getNodedSubstrings=function(){return ou.getNodedSubstrings(this._nodedSegStrings)},oc.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},oc.prototype.findInteriorIntersections=function(t,e){var n=new ic(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},oc.prototype.computeVertexSnaps=function(){var t=this;if(ro(arguments[0],Xo))for(var e=arguments[0].iterator();e.hasNext();){var n=e.next();t.computeVertexSnaps(n)}else if(arguments[0]instanceof ou)for(var r=arguments[0],A=r.getCoordinates(),i=0;i<A.length;i++){var o=new Ju(A[i],t._scaleFactor,t._li);t._pointSnapper.snap(o,r,i)&&r.addIntersection(A[i],i)}},oc.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new pu,this._pointSnapper=new nc(this._noder.getIndex()),this.snapRound(t,this._li)},oc.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),A=new Ju(r,e._scaleFactor,e._li);e._pointSnapper.snap(A)}},oc.prototype.interfaces_=function(){return[fu]},oc.prototype.getClass=function(){return oc};var sc=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new gu,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}},ac={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};sc.prototype.bufferFixedPrecision=function(t){var e=new Wu(new oc(new Aa(1)),t.getScale()),n=new $u(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},sc.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=sc.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ea))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=sc.precisionScaleFactor(this._argGeom,this._distance,n),A=new Aa(r);this.bufferFixedPrecision(A)}},sc.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Aa.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},sc.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},sc.prototype.bufferOriginalPrecision=function(){try{var t=new $u(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof No))throw t;this._saveException=t}},sc.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},sc.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},sc.prototype.interfaces_=function(){return[]},sc.prototype.getClass=function(){return sc},sc.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new sc(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Fo&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new sc(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof gu&&arguments[0]instanceof Fo&&"number"==typeof arguments[1]){var A=arguments[1];return new sc(arguments[0],arguments[2]).getResultGeometry(A)}}else if(4===arguments.length){var i=arguments[1],o=arguments[2],s=arguments[3],a=new sc(arguments[0]);return a.setQuadrantSegments(o),a.setEndCapStyle(s),a.getResultGeometry(i)}},sc.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),A=Ao.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),i=n-Math.trunc(Math.log(A)/Math.log(10)+1);return Math.pow(10,i)},ac.CAP_ROUND.get=function(){return gu.CAP_ROUND},ac.CAP_BUTT.get=function(){return gu.CAP_FLAT},ac.CAP_FLAT.get=function(){return gu.CAP_FLAT},ac.CAP_SQUARE.get=function(){return gu.CAP_SQUARE},ac.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(sc,ac);var uc=function(){this._pt=[new Ki,new Ki],this._distance=Yi.NaN,this._isNull=!0};uc.prototype.getCoordinates=function(){return this._pt},uc.prototype.getCoordinate=function(t){return this._pt[t]},uc.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)}},uc.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],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},uc.prototype.getDistance=function(){return this._distance},uc.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)}},uc.prototype.interfaces_=function(){return[]},uc.prototype.getClass=function(){return uc};var cc=function(){};cc.prototype.interfaces_=function(){return[]},cc.prototype.getClass=function(){return cc},cc.computeDistance=function(){if(arguments[2]instanceof uc&&arguments[0]instanceof Us&&arguments[1]instanceof Ki)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new su,A=0;A<n.length-1;A++){r.setCoordinates(n[A],n[A+1]);var i=r.closestPoint(t);e.setMinimum(i,t)}else if(arguments[2]instanceof uc&&arguments[0]instanceof qs&&arguments[1]instanceof Ki){var o=arguments[0],s=arguments[1],a=arguments[2];cc.computeDistance(o.getExteriorRing(),s,a);for(var u=0;u<o.getNumInteriorRing();u++)cc.computeDistance(o.getInteriorRingN(u),s,a)}else if(arguments[2]instanceof uc&&arguments[0]instanceof Fo&&arguments[1]instanceof Ki){var c=arguments[0],l=arguments[1],f=arguments[2];if(c instanceof Us)cc.computeDistance(c,l,f);else if(c instanceof qs)cc.computeDistance(c,l,f);else if(c instanceof Ns)for(var h=c,p=0;p<h.getNumGeometries();p++){var d=h.getGeometryN(p);cc.computeDistance(d,l,f)}else f.setMinimum(c.getCoordinate(),l)}else if(arguments[2]instanceof uc&&arguments[0]instanceof su&&arguments[1]instanceof Ki){var g=arguments[1],y=arguments[2],_=arguments[0].closestPoint(g);y.setMinimum(_,g)}};var lc=function(t){this._maxPtDist=new uc,this._inputGeom=t||null},fc={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};lc.prototype.computeMaxMidpointDistance=function(t){var e=new pc(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},lc.prototype.computeMaxVertexDistance=function(t){var e=new hc(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},lc.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},lc.prototype.getDistancePoints=function(){return this._maxPtDist},lc.prototype.interfaces_=function(){return[]},lc.prototype.getClass=function(){return lc},fc.MaxPointDistanceFilter.get=function(){return hc},fc.MaxMidpointDistanceFilter.get=function(){return pc},Object.defineProperties(lc,fc);var hc=function(t){this._maxPtDist=new uc,this._minPtDist=new uc,this._geom=t||null};hc.prototype.filter=function(t){this._minPtDist.initialize(),cc.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},hc.prototype.getMaxPointDistance=function(){return this._maxPtDist},hc.prototype.interfaces_=function(){return[Qo]},hc.prototype.getClass=function(){return hc};var pc=function(t){this._maxPtDist=new uc,this._minPtDist=new uc,this._geom=t||null};pc.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),A=new Ki((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),cc.computeDistance(this._geom,A,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},pc.prototype.isDone=function(){return!1},pc.prototype.isGeometryChanged=function(){return!1},pc.prototype.getMaxPointDistance=function(){return this._maxPtDist},pc.prototype.interfaces_=function(){return[xs]},pc.prototype.getClass=function(){return pc};var dc=function(t){this._comps=t||null};dc.prototype.filter=function(t){t instanceof qs&&this._comps.add(t)},dc.prototype.interfaces_=function(){return[Cs]},dc.prototype.getClass=function(){return dc},dc.getPolygons=function(){if(1===arguments.length)return dc.getPolygons(arguments[0],new Jo);if(2===arguments.length){var t=arguments[0],e=arguments[1];return t instanceof qs?e.add(t):t instanceof Ns&&t.apply(new dc(e)),e}};var gc=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}};gc.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof js){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Us&&this._lines.add(t)},gc.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},gc.prototype.interfaces_=function(){return[Bo]},gc.prototype.getClass=function(){return gc},gc.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(gc.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(gc.getLines(e,n))}},gc.getLines=function(){if(1===arguments.length)return gc.getLines(arguments[0],!1);if(2===arguments.length){if(ro(arguments[0],Xo)&&ro(arguments[1],Xo)){for(var t=arguments[1],e=arguments[0].iterator();e.hasNext();){var n=e.next();gc.getLines(n,t)}return t}if(arguments[0]instanceof Fo&&"boolean"==typeof arguments[1]){var r=arguments[0],A=arguments[1],i=new Jo;return r.apply(new gc(i,A)),i}if(arguments[0]instanceof Fo&&ro(arguments[1],Xo)){var o=arguments[0],s=arguments[1];return o instanceof Us?s.add(o):o.apply(new gc(s)),s}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&ro(arguments[0],Xo)&&ro(arguments[1],Xo)){for(var a=arguments[1],u=arguments[2],c=arguments[0].iterator();c.hasNext();){var l=c.next();gc.getLines(l,a,u)}return a}if("boolean"==typeof arguments[2]&&arguments[0]instanceof Fo&&ro(arguments[1],Xo)){var f=arguments[1],h=arguments[2];return arguments[0].apply(new gc(f,h)),f}}};var yc=function(){if(this._boundaryRule=zo.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 qi("Rule must be non-null");this._boundaryRule=t}};yc.prototype.locateInternal=function(){if(arguments[0]instanceof Ki&&arguments[1]instanceof qs){var t=arguments[0],e=arguments[1];if(e.isEmpty())return eo.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===eo.EXTERIOR)return eo.EXTERIOR;if(r===eo.BOUNDARY)return eo.BOUNDARY;for(var A=0;A<e.getNumInteriorRing();A++){var i=e.getInteriorRingN(A),o=this.locateInPolygonRing(t,i);if(o===eo.INTERIOR)return eo.EXTERIOR;if(o===eo.BOUNDARY)return eo.BOUNDARY}return eo.INTERIOR}if(arguments[0]instanceof Ki&&arguments[1]instanceof Us){var s=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(s))return eo.EXTERIOR;var u=a.getCoordinates();return a.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?Po.isOnLine(s,u)?eo.INTERIOR:eo.EXTERIOR:eo.BOUNDARY}if(arguments[0]instanceof Ki&&arguments[1]instanceof zs){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?eo.INTERIOR:eo.EXTERIOR}},yc.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?Po.locatePointInRing(t,e.getCoordinates()):eo.EXTERIOR},yc.prototype.intersects=function(t,e){return this.locate(t,e)!==eo.EXTERIOR},yc.prototype.updateLocationInfo=function(t){t===eo.INTERIOR&&(this._isIn=!0),t===eo.BOUNDARY&&this._numBoundaries++},yc.prototype.computeLocation=function(t,e){var n=this;if(e instanceof zs&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Us)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof qs)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ss)for(var r=e,A=0;A<r.getNumGeometries();A++){var i=r.getGeometryN(A);n.updateLocationInfo(n.locateInternal(t,i))}else if(e instanceof Hs)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);n.updateLocationInfo(n.locateInternal(t,a))}else if(e instanceof Ns)for(var u=new Ou(e);u.hasNext();){var c=u.next();c!==e&&n.computeLocation(t,c)}},yc.prototype.locate=function(t,e){return e.isEmpty()?eo.EXTERIOR:e instanceof Us||e instanceof qs?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?eo.BOUNDARY:this._numBoundaries>0||this._isIn?eo.INTERIOR:eo.EXTERIOR)},yc.prototype.interfaces_=function(){return[]},yc.prototype.getClass=function(){return yc};var _c=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}},mc={INSIDE_AREA:{configurable:!0}};_c.prototype.isInsideArea=function(){return this._segIndex===_c.INSIDE_AREA},_c.prototype.getCoordinate=function(){return this._pt},_c.prototype.getGeometryComponent=function(){return this._component},_c.prototype.getSegmentIndex=function(){return this._segIndex},_c.prototype.interfaces_=function(){return[]},_c.prototype.getClass=function(){return _c},mc.INSIDE_AREA.get=function(){return-1},Object.defineProperties(_c,mc);var vc=function(t){this._pts=t||null};vc.prototype.filter=function(t){t instanceof zs&&this._pts.add(t)},vc.prototype.interfaces_=function(){return[Cs]},vc.prototype.getClass=function(){return vc},vc.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof zs?ja.singletonList(t):vc.getPoints(t,new Jo)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof zs?n.add(e):e instanceof Ns&&e.apply(new vc(n)),n}};var Ec=function(){this._locations=null;var t=arguments[0];this._locations=t};Ec.prototype.filter=function(t){(t instanceof zs||t instanceof Us||t instanceof qs)&&this._locations.add(new _c(t,0,t.getCoordinate()))},Ec.prototype.interfaces_=function(){return[Cs]},Ec.prototype.getClass=function(){return Ec},Ec.getLocations=function(t){var e=new Jo;return t.apply(new Ec(e)),e};var wc=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new yc,this._minDistanceLocation=null,this._minDistance=Yi.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],A=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=A}};wc.prototype.computeContainmentDistance=function(){var t=this;if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1],A=1-n,i=dc.getPolygons(this._geom[n]);if(i.size()>0){var o=Ec.getLocations(this._geom[A]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[A]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&ro(arguments[0],Ko)&&ro(arguments[1],Ko)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),f=0;f<a.size();f++)if(t.computeContainmentDistance(l,a.get(f),u),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof _c&&arguments[1]instanceof qs){var h=arguments[0],p=arguments[1],d=arguments[2],g=h.getCoordinate();if(eo.EXTERIOR!==this._ptLocator.locate(g,p))return this._minDistance=0,d[0]=h,d[1]=new _c(p,g),null}},wc.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=this,A=0;A<t.size();A++)for(var i=t.get(A),o=0;o<e.size();o++){var s=e.get(o);if(r.computeMinDistance(i,s,n),r._minDistance<=r._terminateDistance)return null}},wc.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=gc.getLines(this._geom[0]),n=gc.getLines(this._geom[1]),r=vc.getPoints(this._geom[0]),A=vc.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,A,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,A,t),void this.updateMinDistance(t,!1))))},wc.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},wc.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])},wc.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},wc.prototype.computeMinDistance=function(){var t=this;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 Us&&arguments[1]instanceof zs){var e=arguments[0],n=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var A=e.getCoordinates(),i=n.getCoordinate(),o=0;o<A.length-1;o++){var s=Po.distancePointLine(i,A[o],A[o+1]);if(s<t._minDistance){t._minDistance=s;var a=new su(A[o],A[o+1]).closestPoint(i);r[0]=new _c(e,o,a),r[1]=new _c(n,0,i)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Us&&arguments[1]instanceof Us){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var f=u.getCoordinates(),h=c.getCoordinates(),p=0;p<f.length-1;p++)for(var d=0;d<h.length-1;d++){var g=Po.distanceLineLine(f[p],f[p+1],h[d],h[d+1]);if(g<t._minDistance){t._minDistance=g;var y=new su(f[p],f[p+1]),_=new su(h[d],h[d+1]),m=y.closestPoints(_);l[0]=new _c(u,p,m[0]),l[1]=new _c(c,d,m[1])}if(t._minDistance<=t._terminateDistance)return null}}},wc.prototype.computeMinDistancePoints=function(t,e,n){for(var r=this,A=0;A<t.size();A++)for(var i=t.get(A),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<r._minDistance&&(r._minDistance=a,n[0]=new _c(i,0,i.getCoordinate()),n[1]=new _c(s,0,s.getCoordinate())),r._minDistance<=r._terminateDistance)return null}},wc.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new qi("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},wc.prototype.computeMinDistanceLines=function(t,e,n){for(var r=this,A=0;A<t.size();A++)for(var i=t.get(A),o=0;o<e.size();o++){var s=e.get(o);if(r.computeMinDistance(i,s,n),r._minDistance<=r._terminateDistance)return null}},wc.prototype.interfaces_=function(){return[]},wc.prototype.getClass=function(){return wc},wc.distance=function(t,e){return new wc(t,e).distance()},wc.isWithinDistance=function(t,e,n){return new wc(t,e,n).distance()<=n},wc.nearestPoints=function(t,e){return new wc(t,e).nearestPoints()};var bc=function(){this._pt=[new Ki,new Ki],this._distance=Yi.NaN,this._isNull=!0};bc.prototype.getCoordinates=function(){return this._pt},bc.prototype.getCoordinate=function(t){return this._pt[t]},bc.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)}},bc.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],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},bc.prototype.toString=function(){return xo.toLineString(this._pt[0],this._pt[1])},bc.prototype.getDistance=function(){return this._distance},bc.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)}},bc.prototype.interfaces_=function(){return[]},bc.prototype.getClass=function(){return bc};var Ic=function(){};Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic},Ic.computeDistance=function(){if(arguments[2]instanceof bc&&arguments[0]instanceof Us&&arguments[1]instanceof Ki)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new su,A=t.getCoordinates(),i=0;i<A.length-1;i++){r.setCoordinates(A[i],A[i+1]);var o=r.closestPoint(e);n.setMinimum(o,e)}else if(arguments[2]instanceof bc&&arguments[0]instanceof qs&&arguments[1]instanceof Ki){var s=arguments[0],a=arguments[1],u=arguments[2];Ic.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)Ic.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof bc&&arguments[0]instanceof Fo&&arguments[1]instanceof Ki){var l=arguments[0],f=arguments[1],h=arguments[2];if(l instanceof Us)Ic.computeDistance(l,f,h);else if(l instanceof qs)Ic.computeDistance(l,f,h);else if(l instanceof Ns)for(var p=l,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);Ic.computeDistance(g,f,h)}else h.setMinimum(l.getCoordinate(),f)}else if(arguments[2]instanceof bc&&arguments[0]instanceof su&&arguments[1]instanceof Ki){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var Cc=function(){this._g0=null,this._g1=null,this._ptDist=new bc,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},xc={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Cc.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Cc.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new qi("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Cc.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Cc.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Cc.prototype.computeOrientedDistance=function(t,e,n){var r=new Nc(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var A=new Sc(e,this._densifyFrac);t.apply(A),n.setMaximum(A.getMaxPointDistance())}},Cc.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc},Cc.distance=function(){if(2===arguments.length)return new Cc(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Cc(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},xc.MaxPointDistanceFilter.get=function(){return Nc},xc.MaxDensifiedByFractionDistanceFilter.get=function(){return Sc},Object.defineProperties(Cc,xc);var Nc=function(){this._maxPtDist=new bc,this._minPtDist=new bc,this._euclideanDist=new Ic,this._geom=null;var t=arguments[0];this._geom=t};Nc.prototype.filter=function(t){this._minPtDist.initialize(),Ic.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Nc.prototype.getMaxPointDistance=function(){return this._maxPtDist},Nc.prototype.interfaces_=function(){return[Qo]},Nc.prototype.getClass=function(){return Nc};var Sc=function(){this._maxPtDist=new bc,this._minPtDist=new bc,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Sc.prototype.filter=function(t,e){var n=this;if(0===e)return null;for(var r=t.getCoordinate(e-1),A=t.getCoordinate(e),i=(A.x-r.x)/this._numSubSegs,o=(A.y-r.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=r.x+s*i,u=r.y+s*o,c=new Ki(a,u);n._minPtDist.initialize(),Ic.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},Sc.prototype.isDone=function(){return!1},Sc.prototype.isGeometryChanged=function(){return!1},Sc.prototype.getMaxPointDistance=function(){return this._maxPtDist},Sc.prototype.interfaces_=function(){return[xs]},Sc.prototype.getClass=function(){return Sc};var Dc=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},Lc={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Dc.prototype.checkMaximumDistance=function(t,e,n){var r=new Cc(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var A=r.getCoordinates();this._errorLocation=A[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+xo.toLineString(A[0],A[1])+")"}},Dc.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Dc.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(),Dc.VERBOSE&&_o.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Dc.prototype.checkNegativeValid=function(){if(!(this._input instanceof qs||this._input instanceof Hs||this._input instanceof Ns))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)},Dc.prototype.getErrorIndicator=function(){return this._errorIndicator},Dc.prototype.checkMinimumDistance=function(t,e,n){var r=new wc(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var A=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+xo.toLineString(A[0],A[1])+" )"}},Dc.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)},Dc.prototype.getErrorLocation=function(){return this._errorLocation},Dc.prototype.getPolygonLines=function(t){for(var e=new Jo,n=new gc(e),r=dc.getPolygons(t).iterator();r.hasNext();){r.next().apply(n)}return t.getFactory().buildGeometry(e)},Dc.prototype.getErrorMessage=function(){return this._errMsg},Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Lc.VERBOSE.get=function(){return!1},Lc.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Dc,Lc);var Tc=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},Mc={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Tc.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},Tc.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Tc.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new vo(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new vo(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")},Tc.prototype.checkDistance=function(){var t=new Dc(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")},Tc.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")},Tc.prototype.checkPolygonal=function(){this._result instanceof qs||this._result instanceof Hs||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Tc.prototype.getErrorIndicator=function(){return this._errorIndicator},Tc.prototype.getErrorLocation=function(){return this._errorLocation},Tc.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"))},Tc.prototype.report=function(t){if(!Tc.VERBOSE)return null;_o.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Tc.prototype.getErrorMessage=function(){return this._errorMsg},Tc.prototype.interfaces_=function(){return[]},Tc.prototype.getClass=function(){return Tc},Tc.isValidMsg=function(t,e,n){var r=new Tc(t,e,n);return r.isValid()?null:r.getErrorMessage()},Tc.isValid=function(t,e,n){return!!new Tc(t,e,n).isValid()},Mc.VERBOSE.get=function(){return!1},Mc.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Tc,Mc);var Oc=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Oc.prototype.getCoordinates=function(){return this._pts},Oc.prototype.size=function(){return this._pts.length},Oc.prototype.getCoordinate=function(t){return this._pts[t]},Oc.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Oc.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ru.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Oc.prototype.setData=function(t){this._data=t},Oc.prototype.getData=function(){return this._data},Oc.prototype.toString=function(){return xo.toLineString(new Js(this._pts))},Oc.prototype.interfaces_=function(){return[Au]},Oc.prototype.getClass=function(){return Oc};var Rc=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Jo,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Rc.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Rc.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Rc.prototype.getIntersectionSegments=function(){return this._intSegments},Rc.prototype.count=function(){return this._intersectionCount},Rc.prototype.getIntersections=function(){return this._intersections},Rc.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Rc.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Rc.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 A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=A,this._intSegments[1]=i,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Rc.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Rc.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Rc.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Rc.prototype.interfaces_=function(){return[Uu]},Rc.prototype.getClass=function(){return Rc},Rc.createAllIntersectionsFinder=function(t){var e=new Rc(t);return e.setFindAllIntersections(!0),e},Rc.createAnyIntersectionFinder=function(t){return new Rc(t)},Rc.createIntersectionCounter=function(t){var e=new Rc(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Pc=function(){this._li=new Mo,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Pc.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Pc.prototype.getIntersections=function(){return this._segInt.getIntersections()},Pc.prototype.isValid=function(){return this.execute(),this._isValid},Pc.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Pc.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Rc(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new pu;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Pc.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ea(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Pc.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+xo.toLineString(t[0],t[1])+" and "+xo.toLineString(t[2],t[3])},Pc.prototype.interfaces_=function(){return[]},Pc.prototype.getClass=function(){return Pc},Pc.computeIntersections=function(t){var e=new Pc(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var kc=function t(){this._nv=null;var e=arguments[0];this._nv=new Pc(t.toSegmentStrings(e))};kc.prototype.checkValid=function(){this._nv.checkValid()},kc.prototype.interfaces_=function(){return[]},kc.prototype.getClass=function(){return kc},kc.toSegmentStrings=function(t){for(var e=new Jo,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Oc(r.getCoordinates(),r))}return e},kc.checkValid=function(t){new kc(t).checkValid()};var Bc=function(t){this._mapOp=t};Bc.prototype.map=function(t){for(var e=new Jo,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(aa.toGeometryArray(e))},Bc.prototype.interfaces_=function(){return[]},Bc.prototype.getClass=function(){return Bc},Bc.map=function(t,e){return new Bc(e).map(t)};var Fc=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Jo,this._resultLineList=new Jo;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Fc.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var r=n.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}},Fc.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Fc.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Fc.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),A=t.getEdge();t.isLineEdge()&&(t.isVisited()||!_l.isResultOfOp(r,e)||A.isCovered()||(n.add(A),t.setVisitedEdge(!0)))},Fc.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 A=this._op.isCoveredByA(n.getCoordinate());r.setCovered(A)}}},Fc.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))}},Fc.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)}},Fc.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(Do.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(_l.isResultOfOp(r,e)&&e===_l.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Fc.prototype.interfaces_=function(){return[]},Fc.prototype.getClass=function(){return Fc};var Gc=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Jo;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Gc.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Gc.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===_l.INTERSECTION))){var r=n.getLabel();_l.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Gc.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Gc.prototype.interfaces_=function(){return[]},Gc.prototype.getClass=function(){return Gc};var Uc=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Uc.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Uc.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof js&&!r.isEmpty()||(n=!1);for(var A=new Jo,i=0;i<t.getNumInteriorRing();i++){var o=this.transformLinearRing(t.getInteriorRingN(i),t);null===o||o.isEmpty()||(o instanceof js||(n=!1),A.add(o))}if(n)return this._factory.createPolygon(r,A.toArray([]));var s=new Jo;return null!==r&&s.add(r),s.addAll(A),this._factory.buildGeometry(s)},Uc.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Uc.prototype.getInputGeometry=function(){return this._inputGeom},Uc.prototype.transformMultiLineString=function(t,e){for(var n=new Jo,r=0;r<t.getNumGeometries();r++){var A=this.transformLineString(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Uc.prototype.transformCoordinates=function(t,e){return this.copy(t)},Uc.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Uc.prototype.transformMultiPoint=function(t,e){for(var n=new Jo,r=0;r<t.getNumGeometries();r++){var A=this.transformPoint(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Uc.prototype.transformMultiPolygon=function(t,e){for(var n=new Jo,r=0;r<t.getNumGeometries();r++){var A=this.transformPolygon(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Uc.prototype.copy=function(t){return t.copy()},Uc.prototype.transformGeometryCollection=function(t,e){for(var n=new Jo,r=0;r<t.getNumGeometries();r++){var A=this.transform(t.getGeometryN(r));null!==A&&(this._pruneEmptyGeometry&&A.isEmpty()||n.add(A))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(aa.toGeometryArray(n)):this._factory.buildGeometry(n)},Uc.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof zs)return this.transformPoint(t,null);if(t instanceof Ys)return this.transformMultiPoint(t,null);if(t instanceof js)return this.transformLinearRing(t,null);if(t instanceof Us)return this.transformLineString(t,null);if(t instanceof Ss)return this.transformMultiLineString(t,null);if(t instanceof qs)return this.transformPolygon(t,null);if(t instanceof Hs)return this.transformMultiPolygon(t,null);if(t instanceof Ns)return this.transformGeometryCollection(t,null);throw new qi("Unknown Geometry subtype: "+t.getClass().getName())},Uc.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)},Uc.prototype.interfaces_=function(){return[]},Uc.prototype.getClass=function(){return Uc};var Qc=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new su,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Us&&"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}};Qc.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var A=t.get(r),i=this.findSnapForVertex(A,e);null!==i&&(t.set(r,new Ki(i)),0===r&&this._isClosed&&t.set(t.size()-1,new Ki(i)))}},Qc.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},Qc.prototype.snapTo=function(t){var e=new es(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Qc.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 A=e[r],i=this.findSegmentIndexToSnap(A,t);i>=0&&t.add(i+1,new Ki(A),!1)}},Qc.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=Yi.MAX_VALUE,A=-1,i=0;i<e.size()-1;i++){if(n._seg.p0=e.get(i),n._seg.p1=e.get(i+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var o=n._seg.distance(t);o<n._snapTolerance&&o<r&&(r=o,A=i)}return A},Qc.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Qc.prototype.interfaces_=function(){return[]},Qc.prototype.getClass=function(){return Qc},Qc.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var zc=function(t){this._srcGeom=t||null},Vc={SNAP_PRECISION_FACTOR:{configurable:!0}};zc.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new qc(e,n).transform(this._srcGeom)},zc.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new qc(t,n,!0).transform(this._srcGeom),A=r;return e&&ro(A,Vs)&&(A=r.buffer(0)),A},zc.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},zc.prototype.extractTargetCoordinates=function(t){for(var e=new vs,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},zc.prototype.computeMinimumSegmentLength=function(t){for(var e=Yi.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc},zc.snap=function(t,e,n){var r=new Array(2).fill(null),A=new zc(t);r[0]=A.snapTo(e,n);var i=new zc(e);return r[1]=i.snapTo(r[0],n),r},zc.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=zc.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Aa.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var A=arguments[0],i=arguments[1];return Math.min(zc.computeOverlaySnapTolerance(A),zc.computeOverlaySnapTolerance(i))}},zc.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*zc.SNAP_PRECISION_FACTOR},zc.snapToSelf=function(t,e,n){return new zc(t).snapToSelf(e,n)},Vc.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(zc,Vc);var qc=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 Qc(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}(Uc),Yc=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Yc.prototype.getCommon=function(){return Yi.longBitsToDouble(this._commonBits)},Yc.prototype.add=function(t){var e=Yi.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Yc.signExpBits(this._commonBits),this._isFirst=!1,null):Yc.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Yc.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Yc.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Yc.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=Yi.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+Yi.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc},Yc.getBit=function(t,e){return t&1<<e?1:0},Yc.signExpBits=function(t){return t>>52},Yc.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Yc.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Yc.getBit(t,r)!==Yc.getBit(e,r))return n;n++}return 52};var jc=function(){this._commonCoord=null,this._ccFilter=new Xc},Hc={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};jc.prototype.addCommonBits=function(t){var e=new $c(this._commonCoord);t.apply(e),t.geometryChanged()},jc.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new Ki(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new $c(e);return t.apply(n),t.geometryChanged(),t},jc.prototype.getCommonCoordinate=function(){return this._commonCoord},jc.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},jc.prototype.interfaces_=function(){return[]},jc.prototype.getClass=function(){return jc},Hc.CommonCoordinateFilter.get=function(){return Xc},Hc.Translater.get=function(){return $c},Object.defineProperties(jc,Hc);var Xc=function(){this._commonBitsX=new Yc,this._commonBitsY=new Yc};Xc.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Xc.prototype.getCommonCoordinate=function(){return new Ki(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Xc.prototype.interfaces_=function(){return[Qo]},Xc.prototype.getClass=function(){return Xc};var $c=function(){this.trans=null;var t=arguments[0];this.trans=t};$c.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)},$c.prototype.isDone=function(){return!1},$c.prototype.isGeometryChanged=function(){return!0},$c.prototype.interfaces_=function(){return[xs]},$c.prototype.getClass=function(){return $c};var Wc=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()};Wc.prototype.selfSnap=function(t){return new zc(t).snapTo(t,this._snapTolerance)},Wc.prototype.removeCommonBits=function(t){this._cbr=new jc,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},Wc.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Wc.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=_l.overlayOp(e[0],e[1],t);return this.prepareResult(n)},Wc.prototype.checkValid=function(t){t.isValid()||_o.out.println("Snapped geometry is invalid")},Wc.prototype.computeSnapTolerance=function(){this._snapTolerance=zc.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Wc.prototype.snap=function(t){var e=this.removeCommonBits(t);return zc.snap(e[0],e[1],this._snapTolerance)},Wc.prototype.interfaces_=function(){return[]},Wc.prototype.getClass=function(){return Wc},Wc.overlayOp=function(t,e,n){return new Wc(t,e).getResultGeometry(n)},Wc.union=function(t,e){return Wc.overlayOp(t,e,_l.UNION)},Wc.intersection=function(t,e){return Wc.overlayOp(t,e,_l.INTERSECTION)},Wc.symDifference=function(t,e){return Wc.overlayOp(t,e,_l.SYMDIFFERENCE)},Wc.difference=function(t,e){return Wc.overlayOp(t,e,_l.DIFFERENCE)};var Kc=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Kc.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=_l.overlayOp(this._geom[0],this._geom[1],t);n=!0}catch(t){if(!(t instanceof No))throw t;r=t}if(!n)try{e=Wc.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof No?r:t}return e},Kc.prototype.interfaces_=function(){return[]},Kc.prototype.getClass=function(){return Kc},Kc.overlayOp=function(t,e,n){return new Kc(t,e).getResultGeometry(n)},Kc.union=function(t,e){return Kc.overlayOp(t,e,_l.UNION)},Kc.intersection=function(t,e){return Kc.overlayOp(t,e,_l.INTERSECTION)},Kc.symDifference=function(t,e){return Kc.overlayOp(t,e,_l.SYMDIFFERENCE)},Kc.difference=function(t,e){return Kc.overlayOp(t,e,_l.DIFFERENCE)};var Zc=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Zc.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Zc.prototype.interfaces_=function(){return[]},Zc.prototype.getClass=function(){return Zc};var Jc=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],A=arguments[1],i=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=A,this._obj=i}},tl={INSERT:{configurable:!0},DELETE:{configurable:!0}};Jc.prototype.isDelete=function(){return this._eventType===Jc.DELETE},Jc.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Jc.prototype.getObject=function(){return this._obj},Jc.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},Jc.prototype.getInsertEvent=function(){return this._insertEvent},Jc.prototype.isInsert=function(){return this._eventType===Jc.INSERT},Jc.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Jc.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Jc.prototype.interfaces_=function(){return[Hi]},Jc.prototype.getClass=function(){return Jc},tl.INSERT.get=function(){return 1},tl.DELETE.get=function(){return 2},Object.defineProperties(Jc,tl);var el=function(){};el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el};var nl=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};nl.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(nl.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.getNumPoints()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},nl.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},nl.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},nl.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},nl.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},nl.prototype.hasProperIntersection=function(){return this._hasProper},nl.prototype.hasIntersection=function(){return this._hasIntersection},nl.prototype.isDone=function(){return this._isDone},nl.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},nl.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},nl.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,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))))},nl.prototype.interfaces_=function(){return[]},nl.prototype.getClass=function(){return nl},nl.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var rl=function(t){function e(){t.call(this),this.events=new Jo,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){ja.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 nl&&ro(arguments[0],Ko)&&ro(arguments[1],Ko)){var r=arguments[0],A=arguments[1],i=arguments[2];this.addEdges(r,r),this.addEdges(A,A),this.computeIntersections(i)}else if("boolean"==typeof arguments[2]&&ro(arguments[0],Ko)&&arguments[1]instanceof nl){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(),A=0;A<r.length-1;A++){var i=new Zc(n,A),o=new Jc(e,n.getMinX(A),i);this.events.add(o),this.events.add(new Jc(n.getMaxX(A),o))}},e.prototype.processOverlaps=function(t,e,n,r){for(var A=n.getObject(),i=t;i<e;i++){var o=this.events.get(i);if(o.isInsert()){var s=o.getObject();n.isSameLabel(o)||(A.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 A=r.next();this.addEdge(A,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(el),Al=function(){this._min=Yi.POSITIVE_INFINITY,this._max=Yi.NEGATIVE_INFINITY},il={NodeComparator:{configurable:!0}};Al.prototype.getMin=function(){return this._min},Al.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Al.prototype.getMax=function(){return this._max},Al.prototype.toString=function(){return xo.toLineString(new Ki(this._min,0),new Ki(this._max,0))},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al},il.NodeComparator.get=function(){return ol},Object.defineProperties(Al,il);var ol=function(){};ol.prototype.compare=function(t,e){var n=t,r=e,A=(n._min+n._max)/2,i=(r._min+r._max)/2;return A<i?-1:A>i?1:0},ol.prototype.interfaces_=function(){return[$i]},ol.prototype.getClass=function(){return ol};var sl=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}(Al),al=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}(Al),ul=function(){this._leaves=new Jo,this._root=null,this._level=0};ul.prototype.buildTree=function(){ja.sort(this._leaves,new Al.NodeComparator);for(var t=this._leaves,e=null,n=new Jo;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},ul.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 sl(t,e,n))},ul.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},ul.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},ul.prototype.printNode=function(t){_o.out.println(xo.toLineString(new Ki(t._min,this._level),new Ki(t._max,this._level)))},ul.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},ul.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 A=new al(t.get(n),t.get(n+1));e.add(A)}}},ul.prototype.interfaces_=function(){return[]},ul.prototype.getClass=function(){return ul};var cl=function(){this._items=new Jo};cl.prototype.visitItem=function(t){this._items.add(t)},cl.prototype.getItems=function(){return this._items},cl.prototype.interfaces_=function(){return[za]},cl.prototype.getClass=function(){return cl};var ll=function(){this._index=null;var t=arguments[0];if(!ro(t,Vs))throw new qi("Argument must be Polygonal");this._index=new pl(t)},fl={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};ll.prototype.locate=function(t){var e=new Ro(t),n=new hl(e);return this._index.query(t.y,t.y,n),e.getLocation()},ll.prototype.interfaces_=function(){return[Mu]},ll.prototype.getClass=function(){return ll},fl.SegmentVisitor.get=function(){return hl},fl.IntervalIndexedGeometry.get=function(){return pl},Object.defineProperties(ll,fl);var hl=function(){this._counter=null;var t=arguments[0];this._counter=t};hl.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},hl.prototype.interfaces_=function(){return[za]},hl.prototype.getClass=function(){return hl};var pl=function(){this._index=new ul;var t=arguments[0];this.init(t)};pl.prototype.init=function(t){for(var e=gc.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},pl.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new su(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),A=Math.max(n.p0.y,n.p1.y);this._index.insert(r,A,n)}},pl.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new cl;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];this._index.query(r,A,i)}},pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl};var dl=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new ra,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new yc,2===arguments.length){var e=arguments[0],n=arguments[1],r=zo.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];this._argIndex=A,this._parentGeom=i,this._boundaryNodeRule=o,null!==i&&this.add(i)}}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(),A=1;r.getLocation(t,ga.ON)===eo.BOUNDARY&&A++;var i=e.determineBoundary(this._boundaryNodeRule,A);r.setLocation(t,i)},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],A=new nl(arguments[0],!0,!1);A.setIsDoneIfProperInt(r);var i=this.createEdgeSetIntersector(),o=this._parentGeom instanceof js||this._parentGeom instanceof qs||this._parentGeom instanceof Hs,s=n||!o;return i.computeIntersections(this._edges,A,s),this.addSelfIntersectionNodes(this._argIndex),A}},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 nl(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 zs){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,eo.INTERIOR)}else if(arguments[0]instanceof Ki){var e=arguments[0];this.insertPoint(this._argIndex,e,eo.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),eo.EXTERIOR,eo.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,eo.INTERIOR,eo.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],eo.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],eo.BOUNDARY)},e.prototype.addLineString=function(t){var e=ns.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new Xu(e,new Ca(this._argIndex,eo.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),Do.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 A=r.next();e[n++]=A.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===eo.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=ns.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var A=e,i=n;Po.isCCW(r)&&(A=n,i=e);var o=new Xu(r,new Ca(this._argIndex,eo.BOUNDARY,A,i));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],eo.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),A=r.getLabel();null===A?r._label=new Ca(t,n):A.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new rl},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),A=n.eiList.iterator();A.hasNext();){var i=A.next();this.addSelfIntersectionNode(t,i.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 Hs&&(this._useBoundaryDeterminationRule=!1),e instanceof qs)this.addPolygon(e);else if(e instanceof Us)this.addLineString(e);else if(e instanceof zs)this.addPoint(e);else if(e instanceof Ys)this.addCollection(e);else if(e instanceof Ss)this.addCollection(e);else if(e instanceof Hs)this.addCollection(e);else{if(!(e instanceof Ns))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 ro(this._parentGeom,Vs)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new ll(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)?eo.BOUNDARY:eo.INTERIOR},e}(Ba),gl=function(){if(this._li=new Mo,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 dl(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=zo.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 dl(0,e,r),this._arg[1]=new dl(1,n,r)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];A.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(A.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new dl(0,A,o),this._arg[1]=new dl(1,i,o)}};gl.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},gl.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl};var yl=function(){};yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl},yl.map=function(){if(arguments[0]instanceof Fo&&ro(arguments[1],yl.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Jo,r=0;r<t.getNumGeometries();r++){var A=e.map(t.getGeometryN(r));null!==A&&n.add(A)}return t.getFactory().buildGeometry(n)}if(ro(arguments[0],Xo)&&ro(arguments[1],yl.MapOp)){for(var i=arguments[0],o=arguments[1],s=new Jo,a=i.iterator();a.hasNext();){var u=a.next(),c=o.map(u);null!==c&&s.add(c)}return s}},yl.MapOp=function(){};var _l=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new yc,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Gu,this._resultPolyList=new Jo,this._resultLineList=new Jo,this._resultPointList=new Jo,this._graph=new Ba(new Bu),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 Ca(t.getLabel())).flip();var A=e.getDepth();A.isNull()&&A.add(n),A.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,A){var i=new Jo;return i.addAll(t),i.addAll(n),i.addAll(r),i.isEmpty()?e.createEmptyResult(A,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(i)},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)!==eo.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Jo,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 Jo;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),kc.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Fa(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Fc(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var A=new Gc(this,this._geomFact,this._ptLocator);this._resultPointList=A.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(),A=r.getLabel();A.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(A.getLocation(0,ga.RIGHT),A.getLocation(1,ga.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 A=0;A<2;A++)n.isNull(A)||!n.isArea()||r.isNull(A)||(0===r.getDelta(A)?n.toLine(A):(Do.isTrue(!r.isNull(A,ga.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(A,ga.LEFT,r.getLocation(A,ga.LEFT)),Do.isTrue(!r.isNull(A,ga.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(A,ga.RIGHT,r.getLocation(A,ga.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}(gl);_l.overlayOp=function(t,e,n){return new _l(t,e).getResultGeometry(n)},_l.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return _l.createEmptyResult(_l.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Bc.map(t,{interfaces_:function(){return[yl.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Kc.overlayOp(t,e,_l.INTERSECTION)},_l.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return _l.createEmptyResult(_l.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Kc.overlayOp(t,e,_l.SYMDIFFERENCE)},_l.resultDimension=function(t,e,n){var r=e.getDimension(),A=n.getDimension(),i=-1;switch(t){case _l.INTERSECTION:i=Math.min(r,A);break;case _l.UNION:i=Math.max(r,A);break;case _l.DIFFERENCE:i=r;break;case _l.SYMDIFFERENCE:i=Math.max(r,A)}return i},_l.createEmptyResult=function(t,e,n,r){var A=null;switch(_l.resultDimension(t,e,n)){case-1:A=r.createGeometryCollection(new Array(0).fill(null));break;case 0:A=r.createPoint();break;case 1:A=r.createLineString();break;case 2:A=r.createPolygon()}return A},_l.difference=function(t,e){return t.isEmpty()?_l.createEmptyResult(_l.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Kc.overlayOp(t,e,_l.DIFFERENCE))},_l.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return _l.isResultOfOp(n,r,e)}if(3===arguments.length){var A=arguments[0],i=arguments[1];switch(A===eo.BOUNDARY&&(A=eo.INTERIOR),i===eo.BOUNDARY&&(i=eo.INTERIOR),arguments[2]){case _l.INTERSECTION:return A===eo.INTERIOR&&i===eo.INTERIOR;case _l.UNION:return A===eo.INTERIOR||i===eo.INTERIOR;case _l.DIFFERENCE:return A===eo.INTERIOR&&i!==eo.INTERIOR;case _l.SYMDIFFERENCE:return A===eo.INTERIOR&&i!==eo.INTERIOR||A!==eo.INTERIOR&&i===eo.INTERIOR}return!1}},_l.INTERSECTION=1,_l.UNION=2,_l.DIFFERENCE=3,_l.SYMDIFFERENCE=4;var ml=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new yc,this._seg=new su;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};ml.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var r=e._linework.getGeometryN(n).getCoordinateSequence(),A=0;A<r.size()-1;A++){if(r.getCoordinate(A,e._seg.p0),r.getCoordinate(A+1,e._seg.p1),e._seg.distance(t)<=e._boundaryDistanceTolerance)return!0}return!1},ml.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?eo.BOUNDARY:this._ptLocator.locate(t,this._g)},ml.prototype.extractLinework=function(t){var e=new vl;t.apply(e);var n=e.getLinework(),r=aa.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml};var vl=function(){this._linework=null,this._linework=new Jo};vl.prototype.getLinework=function(){return this._linework},vl.prototype.filter=function(t){if(t instanceof qs){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},vl.prototype.interfaces_=function(){return[Cs]},vl.prototype.getClass=function(){return vl};var El=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};El.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),A=0;A<r.length-1;A++)this.computeOffsetPoints(r[A],r[A+1],e,n)},El.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},El.prototype.getPoints=function(t){for(var e=new Jo,n=gc.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},El.prototype.computeOffsetPoints=function(t,e,n,r){var A=e.x-t.x,i=e.y-t.y,o=Math.sqrt(A*A+i*i),s=n*A/o,a=n*i/o,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var l=new Ki(u-a,c+s);r.add(l)}if(this._doRight){var f=new Ki(u+a,c-s);r.add(f)}},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var wl=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 Jo;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new ml(this._geom[0],this._boundaryDistanceTolerance),new ml(this._geom[1],this._boundaryDistanceTolerance),new ml(this._geom[2],this._boundaryDistanceTolerance)]},bl={TOLERANCE:{configurable:!0}};wl.prototype.reportResult=function(t,e,n){_o.out.println("Overlay result invalid - A:"+eo.toLocationSymbol(e[0])+" B:"+eo.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+eo.toLocationSymbol(e[2]))},wl.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},wl.prototype.checkValid=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var r=t._testCoords.get(n);if(!t.checkValid(e,r))return t._invalidLocation=r,!1}return!0}if(2===arguments.length){var A=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),!!wl.hasLocation(this._location,eo.BOUNDARY)||this.isValidResult(A,this._location)}},wl.prototype.addTestPts=function(t){var e=new El(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},wl.prototype.isValidResult=function(t,e){var n=_l.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===eo.INTERIOR);return r||this.reportResult(t,e,n),r},wl.prototype.getInvalidLocation=function(){return this._invalidLocation},wl.prototype.interfaces_=function(){return[]},wl.prototype.getClass=function(){return wl},wl.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},wl.computeBoundaryDistanceTolerance=function(t,e){return Math.min(zc.computeSizeBasedSnapTolerance(t),zc.computeSizeBasedSnapTolerance(e))},wl.isValid=function(t,e,n,r){return new wl(t,e,r).isValid(n)},bl.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(wl,bl);var Il=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Il.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)}},Il.prototype.combine=function(){for(var t=new Jo,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)},Il.prototype.interfaces_=function(){return[]},Il.prototype.getClass=function(){return Il},Il.combine=function(){return 1===arguments.length?new Il(arguments[0]).combine():2===arguments.length?new Il(Il.createList(arguments[0],arguments[1])).combine():3===arguments.length?new Il(Il.createList(arguments[0],arguments[1],arguments[2])).combine():void 0},Il.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Il.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Jo;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2],o=new Jo;return o.add(r),o.add(A),o.add(i),o}};var Cl=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Jo)},xl={STRTREE_NODE_CAPACITY:{configurable:!0}};Cl.prototype.reduceToGeometries=function(t){for(var e=new Jo,n=t.iterator();n.hasNext();){var r=n.next(),A=null;ro(r,Ko)?A=this.unionTree(r):r instanceof Fo&&(A=r),e.add(A)}return e},Cl.prototype.extractByEnvelope=function(t,e,n){for(var r=new Jo,A=0;A<e.getNumGeometries();A++){var i=e.getGeometryN(A);i.getEnvelopeInternal().intersects(t)?r.add(i):n.add(i)}return this._geomFactory.buildGeometry(r)},Cl.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Il.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var A=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,A)},Cl.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 Za(Cl.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)},Cl.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 A=Cl.getGeometry(e,n);return this.unionSafe(A,null)}if(r-n==2)return this.unionSafe(Cl.getGeometry(e,n),Cl.getGeometry(e,n+1));var i=Math.trunc((r+n)/2),o=this.binaryUnion(e,n,i),s=this.binaryUnion(e,i,r);return this.unionSafe(o,s)}},Cl.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},Cl.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Cl.prototype.unionActual=function(t,e){return Cl.restrictToPolygons(t.union(e))},Cl.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Cl.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Jo,A=this.extractByEnvelope(n,t,r),i=this.extractByEnvelope(n,e,r),o=this.unionActual(A,i);return r.add(o),Il.combine(r)},Cl.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)}},Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl},Cl.restrictToPolygons=function(t){if(ro(t,Vs))return t;var e=dc.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(aa.toPolygonArray(e))},Cl.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Cl.union=function(t){return new Cl(t).union()},xl.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Cl,xl);var Nl=function(){};function Sl(){return new Dl}function Dl(){this.reset()}Nl.prototype.interfaces_=function(){return[]},Nl.prototype.getClass=function(){return Nl},Nl.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return _l.createEmptyResult(_l.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Kc.overlayOp(t,e,_l.UNION)},Dl.prototype={constructor:Dl,reset:function(){this.s=this.t=0},add:function(t){Tl(Ll,t,this.t),Tl(this,Ll.s,this.s),this.s?this.t+=Ll.t:this.s=Ll.t},valueOf:function(){return this.s}};var Ll=new Dl;function Tl(t,e,n){var r=t.s=e+n,A=r-e,i=r-A;t.t=e-i+(n-A)}var Ml=1e-6,Ol=Math.PI,Rl=Ol/2,Pl=Ol/4,kl=2*Ol,Bl=180/Ol,Fl=Ol/180,Gl=Math.abs,Ul=Math.atan,Ql=Math.atan2,zl=Math.cos,Vl=Math.sin,ql=Math.sqrt;function Yl(t){return t>1?0:t<-1?Ol:Math.acos(t)}function jl(t){return t>1?Rl:t<-1?-Rl:Math.asin(t)}function Hl(){}function Xl(t,e){t&&Zl.hasOwnProperty(t.type)&&Zl[t.type](t,e)}var $l,Wl,Kl={Feature:function(t,e){Xl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,A=n.length;++r<A;)Xl(n[r].geometry,e)}},Zl={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,A=n.length;++r<A;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Jl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)Jl(n[r],e,0)},Polygon:function(t,e){tf(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)tf(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,A=n.length;++r<A;)Xl(n[r],e)}};function Jl(t,e,n){var r,A=-1,i=t.length-n;for(e.lineStart();++A<i;)r=t[A],e.point(r[0],r[1],r[2]);e.lineEnd()}function tf(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Jl(t[n],e,1);e.polygonEnd()}function ef(t){return[Ql(t[1],t[0]),jl(t[2])]}function nf(t){var e=t[0],n=t[1],r=zl(n);return[r*zl(e),r*Vl(e),Vl(n)]}function rf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Af(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 of(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function sf(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function af(t){var e=ql(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function uf(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 cf(t,e){return[t>Ol?t-kl:t<-Ol?t+kl:t,e]}function lf(t){return function(e,n){return[(e+=t)>Ol?e-kl:e<-Ol?e+kl:e,n]}}function ff(t){var e=lf(t);return e.invert=lf(-t),e}function hf(t,e){var n=zl(t),r=Vl(t),A=zl(e),i=Vl(e);function o(t,e){var o=zl(e),s=zl(t)*o,a=Vl(t)*o,u=Vl(e),c=u*n+s*r;return[Ql(a*A-c*i,s*n-u*r),jl(c*A+a*i)]}return o.invert=function(t,e){var o=zl(e),s=zl(t)*o,a=Vl(t)*o,u=Vl(e),c=u*A-a*i;return[Ql(a*A+u*i,s*n+c*r),jl(c*n-s*r)]},o}function pf(t,e){(e=nf(e))[0]-=t,af(e);var n=Yl(-e[1]);return((-e[2]<0?-n:n)+kl-Ml)%kl}function df(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Hl,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function gf(t,e){return Gl(t[0]-e[0])<Ml&&Gl(t[1]-e[1])<Ml}function yf(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 _f(t,e,n,r,A){var i,o,s=[],a=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(gf(r,o)){for(A.lineStart(),i=0;i<e;++i)A.point((r=t[i])[0],r[1]);A.lineEnd()}else s.push(n=new yf(r,t,null,!0)),a.push(n.o=new yf(r,null,n,!1)),s.push(n=new yf(o,t,null,!1)),a.push(n.o=new yf(o,null,n,!0))}})),s.length){for(a.sort(e),mf(s),mf(a),i=0,o=a.length;i<o;++i)a[i].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,A.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(i=0,o=u.length;i<o;++i)A.point((c=u[i])[0],c[1]);else r(f.x,f.n.x,1,A);f=f.n}else{if(h)for(u=f.p.z,i=u.length-1;i>=0;--i)A.point((c=u[i])[0],c[1]);else r(f.x,f.p.x,-1,A);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);A.lineEnd()}}}function mf(t){if(e=t.length){for(var e,n,r=0,A=t[0];++r<e;)A.n=n=t[r],n.p=A,A=n;A.n=n=t[0],n.p=A}}function vf(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ef(t){for(var e,n,r,A=t.length,i=-1,o=0;++i<A;)o+=t[i].length;for(n=new Array(o);--A>=0;)for(e=(r=t[A]).length;--e>=0;)n[--o]=r[e];return n}Sl(),Sl(),Sl(),cf.invert=cf,1===($l=vf).length&&(Wl=$l,$l=function(t,e){return vf(Wl(t),e)});var wf=1e9,bf=-wf;function If(t,e,n,r){function A(A,i){return t<=A&&A<=n&&e<=i&&i<=r}function i(A,i,s,u){var c=0,l=0;if(null==A||(c=o(A,s))!==(l=o(i,s))||a(A,i)<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(i[0],i[1])}function o(r,A){return Gl(r[0]-t)<Ml?A>0?0:3:Gl(r[0]-n)<Ml?A>0?2:1:Gl(r[1]-e)<Ml?A>0?1:0:A>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=df(),E={point:w,lineStart:function(){E.point=b,u&&u.push(c=[]);y=!0,g=!1,p=d=NaN},lineEnd:function(){a&&(b(l,f),h&&g&&v.rejoin(),a.push(v.result()));E.point=w,g&&m.lineEnd()},polygonStart:function(){m=v,a=[],u=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,A=u.length;n<A;++n)for(var i,o,s=u[n],a=1,c=s.length,l=s[0],f=l[0],h=l[1];a<c;++a)i=f,o=h,f=(l=s[a])[0],h=l[1],o<=r?h>r&&(f-i)*(r-o)>(h-o)*(t-i)&&++e:h<=r&&(f-i)*(r-o)<(h-o)*(t-i)&&--e;return e}(),n=_&&e,A=(a=Ef(a)).length;(n||A)&&(o.polygonStart(),n&&(o.lineStart(),i(null,null,1,o),o.lineEnd()),A&&_f(a,s,e,i,o),o.polygonEnd());m=o,a=u=c=null}};function w(t,e){A(t,e)&&m.point(t,e)}function b(i,o){var s=A(i,o);if(u&&c.push([i,o]),y)l=i,f=o,h=s,y=!1,s&&(m.lineStart(),m.point(i,o));else if(s&&g)m.point(i,o);else{var a=[p=Math.max(bf,Math.min(wf,p)),d=Math.max(bf,Math.min(wf,d))],v=[i=Math.max(bf,Math.min(wf,i)),o=Math.max(bf,Math.min(wf,o))];!function(t,e,n,r,A,i){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=A-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=i-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(i,o),_=!1):(g||(m.lineStart(),m.point(a[0],a[1])),m.point(v[0],v[1]),s||m.lineEnd(),_=!1)}p=i,d=o,g=s}return E}}var Cf=Sl();function xf(t){return t}Sl(),Sl(),Sl();var Nf=1/0,Sf=Nf,Df=-Nf,Lf=Df,Tf={point:function(t,e){t<Nf&&(Nf=t);t>Df&&(Df=t);e<Sf&&(Sf=e);e>Lf&&(Lf=e)},lineStart:Hl,lineEnd:Hl,polygonStart:Hl,polygonEnd:Hl,result:function(){var t=[[Nf,Sf],[Df,Lf]];return Df=Lf=-(Sf=Nf=1/0),t}};function Mf(t,e,n,r){return function(A,i){var o,s,a,u=e(i),c=A.invert(r[0],r[1]),l=df(),f=e(l),h=!1,p={point:d,lineStart:y,lineEnd:_,polygonStart:function(){p.point=m,p.lineStart=v,p.lineEnd=E,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=_,s=Ef(s);var t=function(t,e){var n=e[0],r=e[1],A=[Vl(n),-zl(n),0],i=0,o=0;Cf.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+Pl,p=Vl(h),d=zl(h),g=0;g<c;++g,f=_,p=v,d=E,l=y){var y=u[g],_=y[0],m=y[1]/2+Pl,v=Vl(m),E=zl(m),w=_-f,b=w>=0?1:-1,I=b*w,C=I>Ol,x=p*v;if(Cf.add(Ql(x*b*Vl(I),d*E+x*zl(I))),i+=C?w+b*kl:w,C^f>=n^_>=n){var N=Af(nf(l),nf(y));af(N);var S=Af(A,N);af(S);var D=(C^w>=0?-1:1)*jl(S[2]);(r>D||r===D&&(N[0]||N[1]))&&(o+=C^w>=0?1:-1)}}return(i<-Ml||i<Ml&&Cf<-Ml)^1&o}(o,c);s.length?(h||(i.polygonStart(),h=!0),_f(s,Rf,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){var r=A(e,n);t(e=r[0],n=r[1])&&i.point(e,n)}function g(t,e){var n=A(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=A(t,e);f.point(n[0],n[1])}function v(){f.lineStart(),a=[]}function E(){m(a[0][0],a[0][1]),f.lineEnd();var t,e,n,r,A=f.clean(),u=l.result(),c=u.length;if(a.pop(),o.push(a),a=null,c)if(1&A){if((e=(n=u[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else c>1&&2&A&&u.push(u.pop().concat(u.shift())),s.push(u.filter(Of))}return p}}function Of(t){return t.length>1}function Rf(t,e){return((t=t.x)[0]<0?t[1]-Rl-Ml:Rl-t[1])-((e=e.x)[0]<0?e[1]-Rl-Ml:Rl-e[1])}Sl();var Pf=Mf((function(){return!0}),(function(t){var e,n=NaN,r=NaN,A=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Ol:-Ol,a=Gl(i-n);Gl(a-Ol)<Ml?(t.point(n,r=(r+o)/2>0?Rl:-Rl),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(i,r),e=0):A!==s&&a>=Ol&&(Gl(n-A)<Ml&&(n-=A*Ml),Gl(i-s)<Ml&&(i-=s*Ml),r=function(t,e,n,r){var A,i,o=Vl(t-n);return Gl(o)>Ml?Ul((Vl(e)*(i=zl(r))*Vl(n)-Vl(r)*(A=zl(e))*Vl(t))/(A*i*o)):(e+r)/2}(n,r,i,o),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=i,r=o),A=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var A;if(null==t)A=n*Rl,r.point(-Ol,A),r.point(0,A),r.point(Ol,A),r.point(Ol,0),r.point(Ol,-A),r.point(0,-A),r.point(-Ol,-A),r.point(-Ol,0),r.point(-Ol,A);else if(Gl(t[0]-e[0])>Ml){var i=t[0]<e[0]?Ol:-Ol;A=n*i/2,r.point(-i,A),r.point(0,A),r.point(i,A)}else r.point(e[0],e[1])}),[-Ol,-Rl]);function kf(t,e){var n=zl(t),r=n>0,A=Gl(n)>Ml;function i(t,e){return zl(t)*zl(e)>n}function o(t,e,r){var A=[1,0,0],i=Af(nf(t),nf(e)),o=rf(i,i),s=i[0],a=o-s*s;if(!a)return!r&&t;var u=n*o/a,c=-n*s/a,l=Af(A,i),f=sf(A,u);of(f,sf(i,c));var h=l,p=rf(f,h),d=rf(h,h),g=p*p-d*(rf(f,f)-1);if(!(g<0)){var y=ql(g),_=sf(h,(-p-y)/d);if(of(_,f),_=ef(_),!r)return _;var m,v=t[0],E=e[0],w=t[1],b=e[1];E<v&&(m=v,v=E,E=m);var I=E-v,C=Gl(I-Ol)<Ml;if(!C&&b<w&&(m=w,w=b,b=m),C||I<Ml?C?w+b>0^_[1]<(Gl(_[0]-v)<Ml?w:b):w<=_[1]&&_[1]<=b:I>Ol^(v<=_[0]&&_[0]<=E)){var x=sf(h,(-p+y)/d);return of(x,f),[_,ef(x)]}}}function s(e,n){var A=r?t:Ol-t,i=0;return e<-A?i|=1:e>A&&(i|=2),n<-A?i|=4:n>A&&(i|=8),i}return Mf(i,(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=i(l,f),g=r?d?0:s(l,f):d?s(l+(l<0?Ol:-Ol),f):0;if(!e&&(u=a=d)&&t.lineStart(),d!==a&&(!(h=o(e,p))||gf(e,h)||gf(p,h))&&(p[0]+=Ml,p[1]+=Ml,d=i(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(A&&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&&gf(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,A,i){!function(t,e,n,r,A,i){if(n){var o=zl(e),s=Vl(e),a=r*n;null==A?(A=e+r*kl,i=e-a/2):(A=pf(o,A),i=pf(o,i),(r>0?A<i:A>i)&&(A+=r*kl));for(var u,c=A;r>0?c>i:c<i;c-=a)u=ef([o,-s*zl(c),-s*Vl(c)]),t.point(u[0],u[1])}}(i,t,e,A,n,r)}),r?[0,-t]:[-Ol,t-Ol])}function Bf(t){return function(e){var n=new Ff;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Ff(){}function Gf(t,e,n){var r=e[1][0]-e[0][0],A=e[1][1]-e[0][1],i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),function(t,e){t&&Kl.hasOwnProperty(t.type)?Kl[t.type](t,e):Xl(t,e)}(n,t.stream(Tf));var o=Tf.result(),s=Math.min(r/(o[1][0]-o[0][0]),A/(o[1][1]-o[0][1])),a=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(A-s*(o[1][1]+o[0][1]))/2;return null!=i&&t.clipExtent(i),t.scale(150*s).translate([a,u])}Ff.prototype={constructor:Ff,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 Uf=16,Qf=zl(30*Fl);function zf(t,e){return+e?function(t,e){function n(r,A,i,o,s,a,u,c,l,f,h,p,d,g){var y=u-r,_=c-A,m=y*y+_*_;if(m>4*e&&d--){var v=o+f,E=s+h,w=a+p,b=ql(v*v+E*E+w*w),I=jl(w/=b),C=Gl(Gl(w)-1)<Ml||Gl(i-l)<Ml?(i+l)/2:Ql(E,v),x=t(C,I),N=x[0],S=x[1],D=N-r,L=S-A,T=_*D-y*L;(T*T/m>e||Gl((y*D+_*L)/m-.5)>.3||o*f+s*h+a*p<Qf)&&(n(r,A,i,o,s,a,N,S,C,v/=b,E/=b,w,d,g),g.point(N,S),n(N,S,C,v,E,w,u,c,l,f,h,p,d,g))}}return function(e){var r,A,i,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,A){var i=nf([r,A]),o=t(r,A);n(c,l,u,f,h,p,c=o[0],l=o[1],u=r,f=i[0],h=i[1],p=i[2],Uf,e),e.point(c,l)}function m(){d.point=g,e.lineEnd()}function v(){y(),d.point=E,d.lineEnd=w}function E(t,e){_(r=t,e),A=c,i=l,o=f,s=h,a=p,d.point=_}function w(){n(c,l,u,f,h,p,A,i,r,o,s,a,Uf,e),d.lineEnd=m,m()}return d}}(t,e):function(t){return Bf({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Vf=Bf({point:function(t,e){this.stream.point(t*Fl,e*Fl)}});function qf(t){return function(t){var e,n,r,A,i,o,s,a,u,c,l=150,f=480,h=250,p=0,d=0,g=0,y=0,_=0,m=null,v=Pf,E=null,w=xf,b=.5,I=zf(N,b);function C(t){return[(t=i(t[0]*Fl,t[1]*Fl))[0]*l+n,r-t[1]*l]}function x(t){return(t=i.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*Bl,t[1]*Bl]}function N(t,A){return[(t=e(t,A))[0]*l+n,r-t[1]*l]}function S(){i=uf(A=function(t,e,n){return(t%=kl)?e||n?uf(ff(t),hf(e,n)):ff(t):e||n?hf(e,n):cf}(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,C}return C.stream=function(t){return u&&c===t?u:u=Vf(v(A,I(w(c=t))))},C.clipAngle=function(t){return arguments.length?(v=+t?kf(m=t*Fl,6*Fl):(m=null,Pf),D()):m*Bl},C.clipExtent=function(t){return arguments.length?(w=null==t?(E=o=s=a=null,xf):If(E=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1]),D()):null==E?null:[[E,o],[s,a]]},C.scale=function(t){return arguments.length?(l=+t,S()):l},C.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],S()):[f,h]},C.center=function(t){return arguments.length?(p=t[0]%360*Fl,d=t[1]%360*Fl,S()):[p*Bl,d*Bl]},C.rotate=function(t){return arguments.length?(g=t[0]%360*Fl,y=t[1]%360*Fl,_=t.length>2?t[2]%360*Fl:0,S()):[g*Bl,y*Bl,_*Bl]},C.precision=function(t){return arguments.length?(I=zf(N,b=t*t),D()):ql(b)},C.fitExtent=function(t,e){return Gf(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return Gf(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&x,S()}}((function(){return t}))()}function Yf(t){return function(e,n){var r=zl(e),A=zl(n),i=t(r*A);return[i*A*Vl(e),i*Vl(n)]}}function jf(t){return function(e,n){var r=ql(e*e+n*n),A=t(r),i=Vl(A),o=zl(A);return[Ql(e*i,r*o),jl(r&&n*i/r)]}}Yf((function(t){return ql(2/(1+t))})).invert=jf((function(t){return 2*jl(t/2)}));var Hf=Yf((function(t){return(t=Yl(t))&&t/Vl(t)}));function Xf(){return qf(Hf).scale(79.4188).clipAngle(179.999)}function $f(t,e){return[t,e]}function Wf(t,e,n,r){var A=t.properties||{},i="Feature"===t.type?t.geometry:t;if("GeometryCollection"===i.type){var o=[];return bi(t,(function(t){var A=Wf(t,e,n,r);A&&o.push(A)})),di(o)}var s=function(t){var e=Mi(t).geometry.coordinates,n=[-e[0],-e[1]];return Xf().rotate(n).scale(ci)}(i),a={type:i.type,coordinates:Zf(i.coordinates,s)},u=(new pa).read(a),c=gi(yi(e,n),"meters"),l=sc.bufferOp(u,c,r);if(!Kf((l=(new da).write(l)).coordinates))return fi({type:l.type,coordinates:Jf(l.coordinates,s)},A)}function Kf(t){return Array.isArray(t[0])?Kf(t[0]):isNaN(t[0])}function Zf(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return Zf(t,e)}))}function Jf(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Jf(t,e)}))}Hf.invert=jf((function(t){return t})),$f.invert=$f;const th={HOURS_AGO:2,SEVERITY:0,ALT_FROM:5,ALT_TO:52},eh="[SkyPath SDK]: Flow is not running",nh="[SkyPath SDK]: Flow already started",rh="[SkyPath SDK]: Flow already terminated",Ah={INITIALIZED:"initialized",RUNNING:"running",STOPPED:"stopped",TERMINATED:"terminated"},ih=t=>{const e=structuredClone(t);return oh(e)},oh=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})),sh=([t,e])=>[Math.max(-180,Math.min(180,t)),Math.max(-90,Math.min(90,e))],ah=(t,e)=>(void 0===e&&(e={}),{type:"Feature",id:t,properties:e,geometry:{type:"Polygon",coordinates:[WA(t)]}}),uh=t=>t/1852/1852,ch=(t,e)=>{const n=[];for(let r=0;r<t.length;r++){const A=t[r],i=e?.(A)||{};n.push(ah(A,i))}return{type:"FeatureCollection",features:n}},lh=(t=[],e=1)=>{if(!t||!t.length)return;const n=t.reduce(((t,e)=>(t[e.hexId]=e,t)),{}),r=ch(t.map((({hexId:t})=>t)),(t=>n[t])).features.map((t=>{const n=Qi(pi(t.geometry.coordinates),e);return{...t,geometry:n.geometry}}));return{type:"FeatureCollection",features:r}},fh=({hexagons:t})=>t.reduce(((t,e)=>{const{hexId:n,sev:r,alt:A,observationTime:i}=e;return(!t[n]||t[n].sev<r)&&(t[n]={hexId:n,sev:r,alt:A,observationTime:i}),t}),{}),hh=([t,e])=>[e,t],ph=(t,e=0)=>{const n=Ti(t).geometry.coordinates.map((t=>t.map(hh)));return JA(n,e)},dh=(t,e=0,n=!0)=>{const r=t.map((t=>n?hh(t):t));return JA(r,e)},gh=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{hoursAgo:n=th.HOURS_AGO,altitudeFrom:r=th.ALT_FROM,altitudeTo:A=th.ALT_TO,severity:i=th.SEVERITY}=e,o=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=r&&t<=A)).filter((({sev:t})=>t>=i)).filter((({observationTime:t})=>gA().unix()-t<=3600*n))])).filter((([,t])=>t.length>0));return Object.fromEntries(o)},yh=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>Array.isArray(n)?n.map((({hexId:n,...r})=>({hexId:ZA(n,t,e),...r}))):null)).filter(Boolean)},_h={0:700,1:300},mh=({polygon:t,resolution:e,extensionFactor:n=1})=>{const r=function(t,e,n){var r=(n=n||{}).units||"kilometers",A=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 A)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(A<=0)throw new Error("steps must be greater than 0");var i=[];switch(t.type){case"GeometryCollection":return bi(t,(function(t){var n=Wf(t,e,r,A);n&&i.push(n)})),di(i);case"FeatureCollection":return wi(t,(function(t){var n=Wf(t,e,r,A);n&&wi(n,(function(t){t&&i.push(t)}))})),di(i)}return Wf(t,e,r,A)}(pi([t]),_h[e]*n,{units:"kilometers"});return r.geometry.coordinates[0]},vh=25e5,Eh=({polygon:t})=>{const e=Pi(pi([t]));if(uh(e)>vh)throw new Error("Corridor area is too large, maximum allowed area is 2500000 nautical miles")},wh=({polygon:t,precision:e=1})=>{const n=pi([t]);return Number(Math.log2(360/(Ii(n)[2]-Ii(n)[0])).toFixed(e))},bh={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE",CORRIDOR:"CORRIDOR"},Ih={[bh.LARGE]:2,[bh.MEDIUM]:3.5,[bh.SMALL]:1/0},Ch=(t,e=Ih)=>{const n=wh({polygon:t});return Object.entries(e).find((([,t])=>n<=t))[0]};function xh(t){return t*Math.PI/180}function Nh(t){return 180*t/Math.PI}function Sh(t){const e=6378137,[n,r,A,i]=t,o=xh(n),s=xh(r),a=xh(A),u=xh(i),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[Nh(h),Nh(p)]}const Dh=({polygon:t,resolution:e,extensionFactor:n})=>{const r=Ii(pi([t])),A=Ti(Ii(hi(Sh(r)))).geometry.coordinates[0];return mh({polygon:A,resolution:e,extensionFactor:n})};var Lh=Object.freeze({__proto__:null,CORRIDOR_POLYGON_MAX_AREA_NM:vh,HEX_RESOLUTION_BUFFERS:_h,POLYGON_TYPE:bh,adjustAntiMeridianCrossing:ih,adjustFeatureCoordinates:t=>ih(t).map(sh),clampCoordinates:sh,extendPolygonByResolution:mh,getHexIdsByMapBoundsAndResolution:ph,getHexIdsByPolygonAndResolution:dh,getHexIdsFromMapboxMap:(t,e)=>{if(!t)return;const n=t.getBounds().toArray().flat();return ph(n,e)},getHexagonsDataSlice:gh,getHexagonsFeatureCollection:lh,getMapPolygon:t=>{const e=t.getBounds().toArray().flat(),[n,r,A,i]=e;return[[n,i],[n,r],[A,r],[A,i],[n,i]]},getMercatorCenterFromBbox:Sh,getMiddleArea:Dh,getOneLayerHexagonsDataSlice:({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{altitudeFrom:n=th.ALT_FROM,altitudeTo:r=th.ALT_TO,severity:A=th.SEVERITY}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=n&&t<=r)).map((t=>{const e=t.severities.filter((({sev:t})=>t>=A));return{...t,severities:e}})).filter((({severities:t})=>t.length>0))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},getPolygonSize:Ch,getZoomLevel:wh,groupByHexIdAndSelectMostSevere:fh,h3SetToFeatureCollection:ch,h3ToFeature:ah,invertLatLng:hh,normalizeAntiMeridian:oh,prepareHexagonsDataForMapHexagons:yh,prepareOneLayerHexagonsDataForMapHexagons:({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.map((({hexId:n,alt:r,severities:A})=>({hexId:ZA(n,t,e),alt:r,...A[0]})))))},squareMetersToNauticalMiles:uh,validateCorridorArea:Eh});const Th=({event:t,listener:e})=>{if("string"!=typeof t||"function"!=typeof e)throw new sA(`Invalid params - event must be a string and listener must be a function,\n received event - ${t}, listener - ${e}`)};class Mh{constructor(){this.#e=new Map}#e;on(t,e){Th({event:t,listener:e}),this.#e.has(t)||this.#e.set(t,[]),this.#e.get(t).push(e)}off(t,e){if(Th({event:t,listener:e}),!this.#e.has(t))return;const n=this.#e.get(t).filter((t=>t!==e));n.length>0?this.#e.set(t,n):this.#e.delete(t)}emit(t,...e){(({event:t})=>{if("string"!=typeof t)throw new sA(`Invalid params - event must be a string, received event - ${t}`)})({event:t}),this.#e.has(t)&&this.#e.get(t).forEach((t=>{t(...e)}))}once(t,e){Th({event:t,listener:e});const n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n)}clear(){this.#e.clear()}}class Oh{#n=Ah.INITIALIZED;start(){if(this.#n===Ah.RUNNING)throw new Error(nh);this.#n=Ah.RUNNING}stop(){if(this.#n===Ah.TERMINATED)throw new Error(rh);if(this.#n===Ah.INITIALIZED)throw new Error(eh);this.#n=Ah.STOPPED}terminate(){if(this.#n===Ah.TERMINATED)throw new Error(rh);if(this.#n===Ah.INITIALIZED)throw new Error(eh);this.#n=Ah.TERMINATED}get isInitialRun(){return[Ah.INITIALIZED,Ah.TERMINATED].includes(this.#n)}get state(){return this.#n}get isRunning(){return this.#n===Ah.RUNNING}get isStopped(){return this.#n===Ah.STOPPED}get isTerminated(){return this.#n===Ah.TERMINATED}}const Rh={INFO:"/v5/nowcasting/info",DATA:"/v5/nowcasting/{resolution}/{hexId}"},Ph="DATA",kh="UPDATE_CONFIG",Bh="UPDATE_INTERVAL",Fh="LOAD_NOWCASTING_DATA",Gh="IS_PENDING_CHANGE",Uh={FORECAST:0,SEVERITY:2,ALTITUDE:35},Qh=({edrValue:t})=>t<=.13?0:t<=.18?1:t<=.25?2:t<=.4?3:4;class zh{constructor({cacheTokenService:t,nowcastingService:e}){this.#r=9e5,this.#A=t,this.#i=e,this.#o=new Oh,this.#s=new Set}#r;#o;#s;#a=new Mh;onData=t=>{if(!ri(t))throw new sA(eA);this.#a.on(Ph,t)};updateConfig=(t={})=>{this.#a.emit(kh,t)};onChangeIsPending=t=>{if(!ri(t))throw new sA(eA);this.#a.on(Gh,t)};#A;#i;#u=[];#c=[];#l=null;#f=null;#h=new Map;#p=async()=>await this.#A.getToken();#d=async()=>await(this.#i?.getInfo()?.lastUpdatedAt)||gA().unix();#g=async(t,e,n,r,A)=>{try{if(this.#A.checkToken(t)||(t=await this.#p()),!r?.length)return{token:t};A&&e.clear();const i=r.filter((t=>!this.#s.has(t)));i.forEach((t=>this.#s.add(t)));const o=i.filter((t=>!e.has(t)));if(0===o.length)return{token:t};const s=await Promise.allSettled(o.map((e=>{return this.#i.getData({token:t.token,lastUpdatedAt:n,resolution:(r=e,A=zA(r),i=A[0],o=A[1],LA.isValidCell(i,o)?LA.getResolution(i,o):-1),hexId:e}).then((t=>({...t,hexId:e}))).finally((()=>this.#s.delete(e)));var r,A,i,o})));s.map((t=>"rejected"===t.status?null:t.value)).forEach((t=>{if(!t?.hexId)return;const n=t.items.map((({hexIds:t,...e})=>({sev:Qh({edrValue:e?.edr}),...e,hexIds:t})));e.set(t.hexId,n)}));return{nowcastingData:Object.fromEntries(e),token:t}}catch(t){throw new lA("Failed to load nowcasting data",{error:t})}};#y=null;start(){try{const t=this.#o.state===Ah.INITIALIZED||this.#o.state===Ah.TERMINATED;this.#o.start(),this.#y=setInterval((()=>this.#a.emit(Bh,{})),this.#r),t&&(this.#a.on(Bh,this.#_),this.#a.on(Fh,this.#m),this.#a.on(kh,this.#v));const e=t?[]:this.#c;this.#v({hexIds:e})}catch(t){throw new lA("Failed to start nowcasting flow",{error:t})}}stop(){this.#o.stop(),clearInterval(this.#y),this.#y=null,this.#s.clear()}terminate(){this.#o.terminate(),clearInterval(this.#y),this.#y=null,this.#l=null,this.#f=null,this.#u=[],this.#h.clear(),this.#s.clear(),this.#a.clear()}getState=()=>this.#o.state;#m=async({shouldEraseOldData:t=!1,hexIds:e=this.#u,token:n=this.#l,currentDataMap:r=this.#h,lastUpdatedAt:A=this.#f})=>{if(this.#o.state!==Ah.RUNNING)return;this.#a.emit(Gh,!0);const{token:i,nowcastingData:o}=await this.#g(n,r,A,e,t);this.#a.emit(Gh,!1),this.#l=i,this.#f=A,this.#u=e,o&&this.#a.emit(Ph,o)};#_=async({lastUpdatedAt:t=this.#f})=>{if(this.#o.state!==Ah.RUNNING)return;const e=await this.#d();if(!(e!==t))return;this.#f=e;const n={lastUpdatedAt:t=e,shouldEraseOldData:!0};this.#a.emit(Fh,n)};#v=async({hexIds:t,polygon:e})=>{let n,r,A=e?dh(e):t||this.#u;if(this.#o.state!==Ah.RUNNING)return void(this.#c=A);this.#l||(n=await this.#p(),this.#l=n),this.#f||(r=await this.#d(),this.#f=r);const i={token:n,currentDataMap:this.#h,lastUpdatedAt:r,hexIds:A};this.#a.emit(Fh,i)}}class Vh{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:Rh.INFO})).data}catch(t){throw new aA("Failed to get nowcasting info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=Rh.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r,forecastH:13};return(await this.#t({path:A,params:i})).data}catch(t){throw new aA("Failed to get nowcasting data",{error:t})}}}const qh="/v4/aircraft";class Yh{constructor({fetcher:t}){this.#t=t}#t;async getMapping(){try{const t=qh;return await this.#t({path:t,method:Br})}catch(t){throw new aA("Failed to get aircraft mapping",{error:t})}}}const jh="/v5/cache-token",Hh=t=>{if(!t?.expireAt)return!1;const e=(new Date).getTime();return new Date(t.expireAt).getTime()>e};class Xh{#t;constructor({fetcher:t}){this.#t=t}getToken=async()=>{try{return(await this.#t({path:jh})).data}catch(t){throw new aA("Failed to get cache token",{error:t})}};checkToken=Hh}const $h=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 A=(await t.json().catch((()=>{})))?.message?.split(":")?.at(1)?.trim()||"";return[r,A?`(${A})`:""].join(" ")};class Wh{#E;constructor({environment:t,proxyUrl:e}){this.#E=e||Kr[t?.toLowerCase()]||Kr[$r]}authenticate=async({apiKey:t,userId:e,companyName:n,authCallback:r})=>{if(![t,e,n,r].filter(Boolean).length)throw new sA(nA);return r?await this.#w({authCallback:r}):await this.#b({apiKey:t,userId:e,companyName:n})};async#I({token:t}){const e=`${this.#E}${Yr}`,n={method:Br,headers:{[Ur]:t}},r=await fetch(e,n);if(!r.ok){const t=await $h({response:r});throw new Error(t)}const{companyId:A,id:i}=await r.json();return{companyId:A,userId:i}}async#b({apiKey:t,userId:e,companyName:n}){try{const r=await this.#C({apiKey:t,userId:e,companyName:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new cA(AA,{error:t})}}async#w({authCallback:t}){try{const{jwt:e,partnerId:n}=await t(),r=await this.#N({jwt:e,partnerId:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new cA(rA,{error:t})}}#S=async({path:t,headers:e={},body:n})=>{try{const r=`${this.#E}${t}`,A={method:Fr,headers:{[Qr]:"application/json",...e},body:n?JSON.stringify(n):null},i=await fetch(r,A);if(!i.ok){const t=await $h({response:i});throw new Error(t)}const{token:o}=await i.json();return o}catch(t){throw new aA(iA,{error:t})}};#C=async({apiKey:t,userId:e,companyName:n})=>await this.#S({path:zr,headers:{[Gr]:t},body:{user_id:e,airline_icao:n}});#N=async({jwt:t,partnerId:e})=>await this.#S({path:Vr,body:{signedJwt:t,partnerId:e}});#D=async({token:t})=>await this.#S({path:qr,body:{token:t}});#x=({token:t})=>async({path:e="",method:n=Br,params:r,headers:A={},body:i=null,signal:o=null,retry:s=3})=>{let a=0;const u=r?"?"+new URLSearchParams(Object.fromEntries(Object.entries(r||{}).filter((([,t])=>null!=t)))):"",c={url:`${this.#E}${e}${u}`,options:{method:n,headers:{...A,[Ur]:t,[Qr]:"application/json"},body:n!==Br?JSON.stringify(i):null,signal:o}};let l=null;for(;a<s;){a+=1;let e=!1;if(l=await fetch(c.url,c.options).catch((t=>{if(t===jr)return e=!0,null})),e)return{data:null,aborted:!0};if(!l||204===l.status)return{data:null};if(l.ok)return await l.json();401===l.status&&(t=await this.#D({token:t}),c.options.headers[Ur]=t)}const f=await $h({response:l});throw new aA(f,{...l})}}const Kh={DATA:"/adsb/v5/hexagons/{resolution}/{hexId}"},Zh=5,Jh=52,tp={[bh.SMALL]:1,[bh.MEDIUM]:0,[bh.LARGE]:0,[bh.CORRIDOR]:1},ep={[bh.SMALL]:0,[bh.MEDIUM]:1,[bh.LARGE]:1,[bh.CORRIDOR]:1},np={[bh.SMALL]:2,[bh.MEDIUM]:1,[bh.LARGE]:2.5,[bh.CORRIDOR]:1},rp="polygon",Ap="isCorridorMode",ip=(t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=ZA(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)},op=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 sp{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async(t,e)=>{const{polygon:n,polygonSize:r}=t;if(!n||!r)return null;r===bh.CORRIDOR&&Eh({polygon:n});const A=ep[r],{hexIds:i,childCells:o}=(({polygon:t,polygonSize:e})=>{let n=t;const r=tp[e],A=np[e];let i,o;switch(e){case bh.LARGE:n=Dh({polygon:n,resolution:r,extensionFactor:A});break;case bh.CORRIDOR:{o=JA(n,5,!0);const t=t=>KA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=mh({polygon:n,resolution:r,extensionFactor:A})}return i??=JA(n,r,!0),{hexIds:i,childCells:o}})({polygon:n,polygonSize:r});r===bh.LARGE&&([...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),[...this.#L.keys()].forEach((t=>!i.includes(t.split(",")[0])&&this.#L.delete(t))));const s=i.filter((t=>{const e=String([t,r,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:i,updatedAt:o}=n,s=gA().unix()-i,a=gA().unix()-o;return!(s<60)&&!(a<60)}));if(!s.length)return ip(this.#L,[r,A],{childCells:o});const a=s.map((t=>{const n=Kh.DATA.replace("{hexId}",t).replace("{resolution}",String(tp[r])),i=String([t,r,A]),o=this.#L.get(i)?.updatedAt;return this.#t({path:n,method:Br,params:{minSev:A,hoursAgo:4,maxAlt:Jh,minAlt:Zh,since:o},signal:e})}));return(await Promise.allSettled(a)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:gA().unix(),reports:op(t),updatedAt:t.value.data?.updatedAt},i=s[e],o=String([i,r,A]),a=this.#L.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,A=n.reports;r.forEach((n=>t.set(e(n),n))),A.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),s={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:i};this.#L.set(o,s)}else this.#L.set(o,n)})),[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),ip(this.#L,[r,A],{childCells:o})};expire=()=>{const t=[...this.#L.entries()],e=gA().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class ap{constructor({fetcher:t}){this.#T=new sp({fetcher:t}),this.#M=new AbortController,this.#O=ii(500),this.#R=ii(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1}}#P;#T;#M;#k;#B;#F;#O;#R;#G;#U;#Q;#z=async()=>{if(this.#k)try{this.#T.expire(),this.#B&&(this.#M.abort(jr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch(this.#P,this.#M.signal);this.#V(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new lA("Failed to run ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#R.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(jr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new lA("Failed to stop ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!ri(t))throw new sA(eA);this.#G=t};onError=t=>{if(!ri(t))throw new sA(eA);this.#U=t};onIsProcessingChange=t=>{if(!ri(t))throw new sA(eA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e})=>{try{(({polygon:t,isCorridorMode:e})=>{if(!ni(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(!ni(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean")})({polygon:t,isCorridorMode:e});const n=ai({current:this.#P,next:{polygon:t,isCorridorMode:e}}),r={...this.#P};if(n.has(Ap)&&(r.isCorridorMode=e),n.has(rp)&&(r.polygon=t,r.polygonSize=r.isCorridorMode?bh.CORRIDOR:Ch(t)),this.#P=r,!this.#k)return;this.#O.run(this.#z.bind(this))}catch(n){const r=new lA("Failed to updateConfig for ADSB flow",{error:n,config:{polygon:t,isCorridorMode:e}});if(!this.#U)throw r;this.#U(r)}}}const up={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},cp={halfAnHour:"0.5",oneHour:"1",twoHours:"2",fourHours:"4"},lp={DATA:"/one-layer/v5/{res}/{hexId}"},fp=5,hp=52,pp={[bh.SMALL]:1,[bh.MEDIUM]:0,[bh.LARGE]:0,[bh.CORRIDOR]:1},dp={[bh.SMALL]:0,[bh.MEDIUM]:1,[bh.LARGE]:1,[bh.CORRIDOR]:1},gp={[bh.SMALL]:2,[bh.MEDIUM]:1,[bh.LARGE]:2.5,[bh.CORRIDOR]:1},yp="polygon",_p="isCorridorMode",mp="aircraftCategory",vp="hoursAgo",Ep="forecastTs",wp="nowcastingAlt",bp=({forecastTs:t})=>{let e;return e=!t||gA.unix(t).isBefore(gA())||gA.unix(t).isBefore(gA().add(3,"minute"))?gA().unix():t,e},Ip=({oneLayer:t,nowcasting:e,forecastTs:n,nowcastingAlt:r})=>{const A=new Map;t.forEach((t=>A.set(`${t.hexId}-${t.alt}`,t)));const i=(({nowcasting:t,forecastTs:e,nowcastingAlt:n})=>{const r=bp({forecastTs:e}),A=Math.floor((r-gA().unix())/3600);return t?.filter((t=>t.alt===n&&t.forecast===A))})({nowcasting:e,forecastTs:n,nowcastingAlt:r});return i?.forEach((t=>{t.hexIds.forEach((e=>{const n=`${e}-${t.alt}`;if(A.has(n)){const t=A.get(n);t.severities[0].sources.push(0),A.set(n,t)}else A.set(n,(({hexId:t,nowcastItem:e})=>({hexId:t,alt:e.alt,severities:[{edr:null,sev:2===e.sev?1:e.sev,sources:[0],observationTime:gA().add(e.forecast+1,"hour").startOf("hour").unix(),usedSource:0,usedSourceTs:gA().add(e.forecast,"hour").startOf("hour").unix()}]}))({hexId:e,nowcastItem:t}))}))})),[...A.values()]},Cp=({oneLayerStore:t,nowcastingData:e,selector:n,options:r})=>{const{childCells:A,forecastTs:i,nowcastingAlt:o,hoursAgo:s}=r,a=[...t.entries()].filter((([t])=>{const[,...e]=t.split(",");return e.join(",")===n.join(",")})).map((([t,n])=>{const[r]=t.split(","),{reports:a}=n,u=(({reports:t,forecastTs:e,hoursAgo:n})=>{const r=bp({forecastTs:e});return t.map((t=>({...t,severities:[t.severities?.find(((t,e,A)=>{const i=A[e+1],o=t.observationTime,s=i?i.observationTime:gA.unix(t.observationTime).add(Number(n),"hour").unix();return r>=o&&r<s}))].filter(Boolean)}))).filter((t=>t.severities.length))})({reports:a,forecastTs:i,hoursAgo:s}),c=e&&e[r]?Ip({oneLayer:u,nowcasting:e[r],forecastTs:i,nowcastingAlt:o}):a;if(!A?.length)return[r,c];const l=c.filter((t=>{const{hexId:e}=t,n=ZA(e,r,5);return A.includes(n)}));return[r,l]}));return Object.fromEntries(a)},xp=({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]})))}))):[];class Np{constructor({fetcher:t}){this.#t=t,this.#L=new Map,this.#i=new Vh({fetcher:t}),this.#A=new Xh({fetcher:t}),this.#Y={}}#L;#t;#i;#A;#Y;fetch=async(t,e)=>{const{polygon:n,polygonSize:r,aircraftCategory:A,hoursAgo:i,forecastTs:o,nowcastingAlt:s}=t;if(!n||!r)return null;r===bh.CORRIDOR&&Eh({polygon:n});const a=dp[r],{hexIds:u,childCells:c}=(({polygon:t,polygonSize:e})=>{let n=t;const r=pp[e],A=gp[e];let i,o;switch(e){case bh.LARGE:n=Dh({polygon:n,resolution:r,extensionFactor:A});break;case bh.CORRIDOR:{o=JA(n,5,!0);const t=t=>KA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=mh({polygon:n,resolution:r,extensionFactor:A})}return i??=JA(n,r,!0),{hexIds:i,childCells:o}})({polygon:n,polygonSize:r});r===bh.LARGE&&[...this.#L.keys()].forEach((t=>!u.includes(t.split(",")[0])&&this.#L.delete(t)));const l=u.filter((t=>{const e=String([t,r,a,i,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:o,updatedAt:s}=n,u=gA().unix()-o,c=gA().unix()-s;return!(u<60)&&!(c<60)}));if(!l.length)return Cp({oneLayerStore:this.#L,nowcastingData:this.#Y,selector:[r,a,i,A],options:{childCells:c,forecastTs:o,nowcastingAlt:s,hoursAgo:i}});await new Promise((t=>{const e=new zh({cacheTokenService:this.#A,nowcastingService:this.#i});e.onData((n=>{this.#Y={...this.#Y,...n},e.terminate(),t(n)})),e.start(),e.updateConfig({hexIds:l})}));const f=l.map((t=>{const n=lp.DATA.replace("{hexId}",t).replace("{res}",String(pp[r])),o=String([t,r,a,i,A]),s=this.#L.get(o)?.updatedAt;return this.#t({path:n,method:Br,params:{acCat:A,hoursAgo:i,minAlt:fp,maxAlt:hp,since:s},signal:e})}));(await Promise.allSettled(f)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:gA().unix(),reports:xp({responseData:t?.value?.data}),updatedAt:t.value.data?.updatedAt},o=l[e],s=String([o,r,a,i,A]),u=this.#L.get(s);if(!!u?.updatedAt&&!!u?.reports?.length&&u?.updatedAt!==n.updatedAt){const t=(({oldReports:t,newReports:e})=>{const n=new Map,r=t=>`${t.hexId}-${t.alt}`;return t.forEach((t=>n.set(r(t),t))),e.forEach((t=>n.set(r(t),t))),Array.from(n.values())})({oldReports:u.reports,newReports:n.reports}),e={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:t};this.#L.set(s,e)}else this.#L.set(s,n)}));for(const[t,{reports:e,...n}]of this.#L.entries()){const r=e.map((t=>({...t,severities:t?.severities?.filter((t=>t.sev>=a))}))).filter((t=>t.severities.length));r.length?this.#L.set(t,{...n,reports:r}):this.#L.delete(t)}return[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),Cp({oneLayerStore:this.#L,nowcastingData:this.#Y,selector:[r,a,i,A],options:{childCells:c,forecastTs:o,nowcastingAlt:s,hoursAgo:i}})};expire=({hoursAgo:t})=>{this.#L=(({store:t,hoursAgo:e})=>{const n=new Map(t);return[...n.entries()].forEach((t=>{const[r,A]=t,{reports:i,...o}=A,s=[];i.forEach((t=>{const n=t?.severities?.filter((t=>gA.unix(t.observationTime).add(e,"hour").unix()>gA().unix()));n.length&&s.push({...t,severities:n})})),s.length?n.set(r,{...o,reports:s}):n.delete(r)})),n})({store:this.#L,hoursAgo:t})};dispose=()=>this.#L.clear()}class Sp{constructor({fetcher:t}){this.#T=new Np({fetcher:t}),this.#M=new AbortController,this.#O=ii(500),this.#R=ii(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1,hoursAgo:Number(cp.oneHour),forecastTs:null,nowcastingAlt:35,aircraftCategory:up.C60}}#P;#T;#M;#k;#B;#F;#O;#R;#G;#U;#Q;#z=async()=>{if(this.#k)try{this.#T.expire({hoursAgo:this.#P.hoursAgo}),this.#B&&(this.#M.abort(jr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch(this.#P,this.#M.signal);this.#V(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new lA("Failed to run OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#R.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(jr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new lA("Failed to stop OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!ri(t))throw new sA(eA);this.#G=t};onError=t=>{if(!ri(t))throw new sA(eA);this.#U=t};onIsProcessingChange=t=>{if(!ri(t))throw new sA(eA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i})=>{if(!ni(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(!ni(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!ni(n)){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(up).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!ni(r)){if("string"!=typeof r)throw new Error("hoursAgo must be a string");if(!Object.values(cp).includes(r))throw new Error("hoursAgo must be one of the allowed values, '0.5', '1', '2' ,'4'")}if(!ni(A)){if("number"!=typeof A)throw new Error("hoursAgo must be a number");if(!gA.unix(A).isValid())throw new Error("forecastTs must be a valid Unix timestamp")}if(!ni(i)){if("number"!=typeof i)throw new Error("nowcastingAlt must be a number");if(i<5||i>52)throw new Error("nowcastingAlt must be a number between 5 and 52")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i});const o=ai({current:this.#P,next:{polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:Number(r),forecastTs:A,nowcastingAlt:i}}),s={...this.#P};if(o.has(_p)&&(s.isCorridorMode=e),o.has(yp)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?bh.CORRIDOR:Ch(t)),o.has(mp)&&(s.aircraftCategory=n),o.has(vp)&&(s.hoursAgo=Number(r)),o.has(Ep)&&(s.forecastTs=A),o.has(wp)&&(s.nowcastingAlt=i),this.#P=s,!this.#k)return;this.#O.run(this.#z.bind(this))}catch(r){const A=new lA("Failed to update config for OneLayerFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}const Dp={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},Lp={DATA:"/observations/v5/hexagons/{resolution}/{hexId}"},Tp=5,Mp=52,Op={[bh.SMALL]:1,[bh.MEDIUM]:0,[bh.LARGE]:0,[bh.CORRIDOR]:1},Rp={[bh.SMALL]:0,[bh.MEDIUM]:1,[bh.LARGE]:1,[bh.CORRIDOR]:1},Pp={[bh.SMALL]:2,[bh.MEDIUM]:1,[bh.LARGE]:2.5,[bh.CORRIDOR]:1},kp="polygon",Bp="isCorridorMode",Fp="aircraftCategory",Gp={getNowcastingDataSlice:({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{forecast:n=Uh.FORECAST,severity:r=Uh.SEVERITY,altitude:A=Uh.ALTITUDE}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({forecast:t})=>t===n)).filter((({alt:t})=>t===A)).filter((({sev:t})=>t>=r))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},prepareNowcastingDataForMapHexagons:({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.flatMap((({hexIds:n,...r})=>n.map((n=>{let A;try{A=ZA(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:A,...r}})))).filter(Boolean)))}},Up={availableConfigInputs:{aircraftCategory:Dp,hours:{halfAnHour:"0.5",oneHour:"1",twoHours:"2",threeHours:"3",fourHours:"4"},severity:{smooth:0,light:1,lightModerate:2,moderate:3,moderateSevere:4},maxAltitude:52,minAltitude:5,largePolygonHandlingBehavior:{IGNORE:"ignore",USE_MIDDLE_AREA:"loadMiddleArea",EXCLUDE_SMOOTH_SEVERITY:"excludeSmoothSeverity"}}},Qp=({polygon:t,polygonSize:e})=>{let n=t;const r=Op[e],A=Pp[e];let i,o;switch(e){case bh.LARGE:n=Dh({polygon:n,resolution:r,extensionFactor:A});break;case bh.CORRIDOR:{o=JA(n,5,!0);const t=t=>KA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=mh({polygon:n,resolution:r,extensionFactor:A})}return i??=JA(n,r,!0),{hexIds:i,childCells:o}},zp=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]})))},Vp=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?yh({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=yh({data:t}),n=fh({hexagons:e});return lh(Object.values(n))}});class qp{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A}=t;if(!n||!r)return;r===bh.CORRIDOR&&Eh({polygon:n});const i=Rp[r],{hexIds:o}=Qp({polygon:n,polygonSize:r});r===bh.LARGE&&[...this.#L.keys()].forEach((t=>!o.includes(t.split(",")[0])&&this.#L.delete(t)));const s=o.filter((t=>{const e=String([t,r,i,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:o,updatedAt:s}=n,a=gA().unix()-o,u=gA().unix()-s;return!(a<60)&&!(u<60)}));if(!s.length)return;const a=s.map((t=>{const n=Lp.DATA.replace("{hexId}",t).replace("{resolution}",String(Op[r])),o=String([t,r,i,A]),s=this.#L.get(o)?.updatedAt;return this.#t({path:n,method:Br,params:{minSev:i,hoursAgo:4,maxAlt:Mp,minAlt:Tp,acCat:A,since:s},signal:e})}));(await Promise.allSettled(a)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:gA().unix(),reports:zp(t),updatedAt:t.value.data?.updatedAt},o=s[e],a=String([o,r,i,A]),u=this.#L.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,A=n.reports;r.forEach((n=>t.set(e(n),n))),A.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),o={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:i};this.#L.set(a,o)}else this.#L.set(a,n)})),[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t)))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A}=t;if(!n||!r)return Vp();const i=Rp[r],{childCells:o}=Qp({polygon:n,polygonSize:r}),s=((t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=ZA(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)})(this.#L,[r,i,A],{childCells:o}),{historyHours:a,maxAltitude:u,minAltitude:c,minSeverity:l}=e,f=gh({data:s,filters:{hoursAgo:a,altitudeFrom:c,altitudeTo:u,severity:l}});return Vp(f)};expire=()=>{const t=[...this.#L.entries()],e=gA().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class Yp{constructor({fetcher:t}){this.#T=new qp({fetcher:t}),this.#M=new AbortController,this.#O=ii(500),this.#R=ii(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1,aircraftCategory:Dp.C60},this.#j={historyHours:2,maxAltitude:52,minAltitude:5,minSeverity:0}}#P;#j;#T;#M;#H;#k;#B;#O;#R;#F=Vp();#G;#U;#Q;#z=async()=>{if(this.#k)try{if(this.#T.expire(),this.#H){this.#B&&(this.#M.abort(jr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch({config:this.#P,signal:this.#M.signal});this.#V(t),await t}const t=this.#T.getData({config:this.#P,filters:this.#j});this.#G?.(t,this.#F),this.#F=t,this.#H=!1}catch(t){const e=new lA("Failed to run Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#R.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(jr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new lA("Failed to stop Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!ri(t))throw new sA(eA);this.#G=t};onError=t=>{if(!ri(t))throw new sA(eA);this.#U=t};onIsProcessingChange=t=>{if(!ri(t))throw new sA(eA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{if(!ni(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(!ni(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!ni(n)){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(Dp).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!ni(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(!ni(A)){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<0||A>52)throw new Error("maxAltitude must be a number between 0 and 52")}if(!ni(i)){if("number"!=typeof i)throw new Error("minAltitude must be a number");if(i<0||i>52)throw new Error("minAltitude must be a number between 0 and 52")}if(!ni(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:A,minAltitude:i,minSeverity:o});const s={...this.#P},a=ai({current:this.#P,next:{polygon:t,isCorridorMode:e,aircraftCategory:n}});a.has(Bp)&&(s.isCorridorMode=e),a.has(kp)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?bh.CORRIDOR:Ch(t)),a.has(Fp)&&(s.aircraftCategory=n),this.#P=s,this.#j=si({current:this.#j,next:{historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o}}),this.#H=a.size>0,this.#O.run(this.#z.bind(this))}catch(r){const A=new lA("Failed to update config for ObservationsFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}exports.CoreUtils=ui,exports.GeoUtils=Lh,exports.Nowcasting=Gp,exports.Observations=Up,exports.default=async({apiKey:t,userId:e,companyName:n,authCallback:r,environment:A=$r,proxyUrl:i,applicationId:o,isMonitoringEnabled:s=!0,shouldCollectConsoleLogs:a=!1,shouldCollectErrors:u=!1})=>{try{const c=new Wh({environment:A,proxyUrl:i}),{fetcher:l,me:f}=await c.authenticate({apiKey:t,userId:e,companyName:n,authCallback:r});(({isEnabled:t,collectConsole:e,collectErrors:n,applicationId:r,environment:A,companyId:i,userId:o})=>{t&&A?.toLowerCase()!==Hr&&(kr.init({clientToken:"pub0b945dd1505a74367a4f900219c56210",service:"skypath-web-sdk",site:"datadoghq.com",env:A,version:Zr,forwardErrorsToLogs:n,forwardConsoleLogs:e?"all":[],sessionSampleRate:100,beforeSend:t=>{switch(t.origin){case"logger":{const e=t.logger?.name||"unknown-logger",n={[Jr]:tA.SDK}[e]||`[${e}]`;return t.message=`${n} ${t.message}`,!0}case"network":{const e=t?.http?.status_code;return 0!==e||(t.message=[tA.NETWORK,t.message].join(" ")),!0}default:return!1}}}),kr.setGlobalContext({applicationId:r,companyId:i,userId:o}),kr.createLogger(Jr,{level:"info",handler:"http",context:{applicationId:r}}))})({isEnabled:s,collectConsole:a,collectErrors:u,applicationId:o,environment:A,companyId:f?.companyId,userId:f?.userId});const h=new Yh({fetcher:l}),p=await h.getMapping(),d=new hA({fetcher:l}),g=new Vh({fetcher:l}),y=new Xh({fetcher:l});return{createNowcastingFlow:()=>new zh({cacheTokenService:y,nowcastingService:g}),createGtgFlow:()=>new zh({cacheTokenService:y,nowcastingService:d}),createObservationsFlow:()=>new Yp({fetcher:l}),createOneLayerFlow:()=>new Sp({fetcher:l}),createAdsbFlow:()=>new ap({fetcher:l}),mapAircraftIcaoToAircraftType:({icao:t})=>ei({icao:t,mapping:p})}}catch(t){throw new uA(t.message,{error:t})}};