@performant-software/geospatial 3.0.7 → 3.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/dist/index.cjs101.js +1 -1
  2. package/dist/index.cjs102.js +1 -1
  3. package/dist/index.cjs103.js +1 -1
  4. package/dist/index.cjs104.js +1 -1
  5. package/dist/index.cjs109.js +1 -1
  6. package/dist/index.cjs110.js +1 -1
  7. package/dist/index.cjs111.js +1 -1
  8. package/dist/index.cjs112.js +1 -1
  9. package/dist/index.cjs115.js +1 -1
  10. package/dist/index.cjs116.js +1 -1
  11. package/dist/index.cjs117.js +1 -1
  12. package/dist/index.cjs121.js +1 -1
  13. package/dist/index.cjs124.js +1 -1
  14. package/dist/index.cjs128.js +1 -1
  15. package/dist/index.cjs131.js +1 -1
  16. package/dist/index.cjs139.js +1 -1
  17. package/dist/index.cjs14.js +1 -1
  18. package/dist/index.cjs140.js +1 -1
  19. package/dist/index.cjs141.js +1 -1
  20. package/dist/index.cjs142.js +1 -1
  21. package/dist/index.cjs143.js +1 -1
  22. package/dist/index.cjs144.js +1 -1
  23. package/dist/index.cjs145.js +1 -1
  24. package/dist/index.cjs147.js +1 -1
  25. package/dist/index.cjs148.js +1 -1
  26. package/dist/index.cjs149.js +1 -1
  27. package/dist/index.cjs15.js +1 -1
  28. package/dist/index.cjs150.js +1 -1
  29. package/dist/index.cjs151.js +1 -1
  30. package/dist/index.cjs152.js +1 -1
  31. package/dist/index.cjs153.js +1 -1
  32. package/dist/index.cjs154.js +1 -1
  33. package/dist/index.cjs155.js +1 -1
  34. package/dist/index.cjs158.js +1 -1
  35. package/dist/index.cjs159.js +1 -1
  36. package/dist/index.cjs16.js +1 -1
  37. package/dist/index.cjs161.js +1 -1
  38. package/dist/index.cjs162.js +1 -1
  39. package/dist/index.cjs163.js +1 -1
  40. package/dist/index.cjs164.js +1 -1
  41. package/dist/index.cjs165.js +1 -1
  42. package/dist/index.cjs166.js +1 -1
  43. package/dist/index.cjs167.js +1 -1
  44. package/dist/index.cjs168.js +1 -1
  45. package/dist/index.cjs174.js +1 -1
  46. package/dist/index.cjs175.js +1 -1
  47. package/dist/index.cjs176.js +1 -1
  48. package/dist/index.cjs177.js +1 -1
  49. package/dist/index.cjs178.js +1 -1
  50. package/dist/index.cjs181.js +1 -1
  51. package/dist/index.cjs182.js +1 -1
  52. package/dist/index.cjs183.js +1 -1
  53. package/dist/index.cjs184.js +1 -1
  54. package/dist/index.cjs19.js +1 -1
  55. package/dist/index.cjs191.js +1 -1
  56. package/dist/index.cjs191.js.map +1 -1
  57. package/dist/index.cjs192.js +1 -1
  58. package/dist/index.cjs192.js.map +1 -1
  59. package/dist/index.cjs193.js +4 -1
  60. package/dist/index.cjs193.js.map +1 -1
  61. package/dist/index.cjs194.js +1 -1
  62. package/dist/index.cjs194.js.map +1 -1
  63. package/dist/index.cjs195.js +1 -1
  64. package/dist/index.cjs195.js.map +1 -1
  65. package/dist/index.cjs196.js +1 -1
  66. package/dist/index.cjs196.js.map +1 -1
  67. package/dist/index.cjs197.js +1 -1
  68. package/dist/index.cjs197.js.map +1 -1
  69. package/dist/index.cjs198.js +1 -1
  70. package/dist/index.cjs198.js.map +1 -1
  71. package/dist/index.cjs199.js +1 -1
  72. package/dist/index.cjs199.js.map +1 -1
  73. package/dist/index.cjs200.js +1 -1
  74. package/dist/index.cjs200.js.map +1 -1
  75. package/dist/index.cjs201.js +1 -1
  76. package/dist/index.cjs201.js.map +1 -1
  77. package/dist/index.cjs202.js +1 -1
  78. package/dist/index.cjs202.js.map +1 -1
  79. package/dist/index.cjs203.js +1 -1
  80. package/dist/index.cjs203.js.map +1 -1
  81. package/dist/index.cjs204.js +1 -1
  82. package/dist/index.cjs204.js.map +1 -1
  83. package/dist/index.cjs205.js +1 -1
  84. package/dist/index.cjs205.js.map +1 -1
  85. package/dist/index.cjs206.js +1 -1
  86. package/dist/index.cjs206.js.map +1 -1
  87. package/dist/index.cjs207.js +1 -1
  88. package/dist/index.cjs207.js.map +1 -1
  89. package/dist/index.cjs208.js +1 -1
  90. package/dist/index.cjs208.js.map +1 -1
  91. package/dist/index.cjs209.js +1 -1
  92. package/dist/index.cjs209.js.map +1 -1
  93. package/dist/index.cjs21.js +1 -1
  94. package/dist/index.cjs210.js +1 -1
  95. package/dist/index.cjs210.js.map +1 -1
  96. package/dist/index.cjs211.js +1 -1
  97. package/dist/index.cjs211.js.map +1 -1
  98. package/dist/index.cjs212.js +1 -1
  99. package/dist/index.cjs212.js.map +1 -1
  100. package/dist/index.cjs213.js +1 -1
  101. package/dist/index.cjs213.js.map +1 -1
  102. package/dist/index.cjs214.js +1 -1
  103. package/dist/index.cjs214.js.map +1 -1
  104. package/dist/index.cjs215.js +1 -1
  105. package/dist/index.cjs215.js.map +1 -1
  106. package/dist/index.cjs216.js +1 -1
  107. package/dist/index.cjs216.js.map +1 -1
  108. package/dist/index.cjs217.js +1 -1
  109. package/dist/index.cjs217.js.map +1 -1
  110. package/dist/index.cjs218.js +1 -1
  111. package/dist/index.cjs218.js.map +1 -1
  112. package/dist/index.cjs219.js +1 -1
  113. package/dist/index.cjs219.js.map +1 -1
  114. package/dist/index.cjs22.js +1 -1
  115. package/dist/index.cjs220.js +1 -4
  116. package/dist/index.cjs220.js.map +1 -1
  117. package/dist/index.cjs221.js +1 -1
  118. package/dist/index.cjs221.js.map +1 -1
  119. package/dist/index.cjs222.js +1 -1
  120. package/dist/index.cjs222.js.map +1 -1
  121. package/dist/index.cjs223.js +1 -1
  122. package/dist/index.cjs223.js.map +1 -1
  123. package/dist/index.cjs224.js +1 -1
  124. package/dist/index.cjs224.js.map +1 -1
  125. package/dist/index.cjs225.js +1 -1
  126. package/dist/index.cjs225.js.map +1 -1
  127. package/dist/index.cjs226.js +1 -1
  128. package/dist/index.cjs226.js.map +1 -1
  129. package/dist/index.cjs227.js +1 -1
  130. package/dist/index.cjs227.js.map +1 -1
  131. package/dist/index.cjs228.js +1 -1
  132. package/dist/index.cjs228.js.map +1 -1
  133. package/dist/index.cjs229.js +1 -1
  134. package/dist/index.cjs229.js.map +1 -1
  135. package/dist/index.cjs230.js +1 -1
  136. package/dist/index.cjs230.js.map +1 -1
  137. package/dist/index.cjs231.js +1 -1
  138. package/dist/index.cjs231.js.map +1 -1
  139. package/dist/index.cjs232.js +1 -1
  140. package/dist/index.cjs232.js.map +1 -1
  141. package/dist/index.cjs233.js +1 -1
  142. package/dist/index.cjs233.js.map +1 -1
  143. package/dist/index.cjs234.js +1 -1
  144. package/dist/index.cjs234.js.map +1 -1
  145. package/dist/index.cjs235.js +1 -1
  146. package/dist/index.cjs235.js.map +1 -1
  147. package/dist/index.cjs236.js +1 -1
  148. package/dist/index.cjs240.js +1 -1
  149. package/dist/index.cjs243.js +1 -1
  150. package/dist/index.cjs244.js +1 -1
  151. package/dist/index.cjs246.js +1 -1
  152. package/dist/index.cjs249.js +1 -1
  153. package/dist/index.cjs25.js +1 -1
  154. package/dist/index.cjs250.js +1 -1
  155. package/dist/index.cjs251.js +1 -1
  156. package/dist/index.cjs254.js +1 -1
  157. package/dist/index.cjs255.js +1 -1
  158. package/dist/index.cjs257.js +1 -1
  159. package/dist/index.cjs257.js.map +1 -1
  160. package/dist/index.cjs258.js +1 -1
  161. package/dist/index.cjs258.js.map +1 -1
  162. package/dist/index.cjs259.js +1 -1
  163. package/dist/index.cjs259.js.map +1 -1
  164. package/dist/index.cjs260.js +1 -1
  165. package/dist/index.cjs260.js.map +1 -1
  166. package/dist/index.cjs27.js +1 -1
  167. package/dist/index.cjs29.js +1 -1
  168. package/dist/index.cjs30.js +1 -1
  169. package/dist/index.cjs31.js +1 -1
  170. package/dist/index.cjs33.js +1 -1
  171. package/dist/index.cjs34.js +1 -1
  172. package/dist/index.cjs35.js +1 -1
  173. package/dist/index.cjs37.js +1 -1
  174. package/dist/index.cjs38.js +1 -1
  175. package/dist/index.cjs39.js +1 -1
  176. package/dist/index.cjs43.js +1 -1
  177. package/dist/index.cjs44.js +1 -1
  178. package/dist/index.cjs45.js +1 -1
  179. package/dist/index.cjs47.js +1 -1
  180. package/dist/index.cjs48.js +1 -1
  181. package/dist/index.cjs50.js +1 -1
  182. package/dist/index.cjs52.js +1 -1
  183. package/dist/index.cjs57.js +1 -1
  184. package/dist/index.cjs59.js +1 -1
  185. package/dist/index.cjs61.js +1 -1
  186. package/dist/index.cjs62.js +1 -1
  187. package/dist/index.cjs63.js +1 -1
  188. package/dist/index.cjs63.js.map +1 -1
  189. package/dist/index.cjs64.js +1 -1
  190. package/dist/index.cjs64.js.map +1 -1
  191. package/dist/index.cjs65.js +1 -1
  192. package/dist/index.cjs66.js +1 -1
  193. package/dist/index.cjs66.js.map +1 -1
  194. package/dist/index.cjs67.js +1 -1
  195. package/dist/index.cjs67.js.map +1 -1
  196. package/dist/index.cjs68.js +1 -1
  197. package/dist/index.cjs68.js.map +1 -1
  198. package/dist/index.cjs69.js +1 -1
  199. package/dist/index.cjs69.js.map +1 -1
  200. package/dist/index.cjs70.js +1 -1
  201. package/dist/index.cjs70.js.map +1 -1
  202. package/dist/index.cjs71.js +1 -1
  203. package/dist/index.cjs71.js.map +1 -1
  204. package/dist/index.cjs72.js +1 -1
  205. package/dist/index.cjs72.js.map +1 -1
  206. package/dist/index.cjs73.js +1 -1
  207. package/dist/index.cjs73.js.map +1 -1
  208. package/dist/index.cjs74.js +1 -1
  209. package/dist/index.cjs74.js.map +1 -1
  210. package/dist/index.cjs75.js +1 -1
  211. package/dist/index.cjs75.js.map +1 -1
  212. package/dist/index.cjs76.js +1 -1
  213. package/dist/index.cjs76.js.map +1 -1
  214. package/dist/index.cjs77.js +1 -1
  215. package/dist/index.cjs77.js.map +1 -1
  216. package/dist/index.cjs78.js +1 -1
  217. package/dist/index.cjs78.js.map +1 -1
  218. package/dist/index.cjs80.js +1 -1
  219. package/dist/index.cjs87.js +1 -1
  220. package/dist/index.cjs88.js +1 -1
  221. package/dist/index.cjs89.js +1 -1
  222. package/dist/index.cjs90.js +1 -1
  223. package/dist/index.cjs91.js +1 -1
  224. package/dist/index.cjs92.js +1 -1
  225. package/dist/index.cjs93.js +1 -1
  226. package/dist/index.cjs94.js +1 -1
  227. package/dist/index.cjs95.js +1 -1
  228. package/dist/index.cjs98.js +1 -1
  229. package/dist/index.cjs99.js +1 -1
  230. package/dist/index.es101.js +3 -3
  231. package/dist/index.es102.js +1 -1
  232. package/dist/index.es103.js +2 -2
  233. package/dist/index.es104.js +1 -1
  234. package/dist/index.es109.js +1 -1
  235. package/dist/index.es110.js +1 -1
  236. package/dist/index.es111.js +1 -1
  237. package/dist/index.es112.js +1 -1
  238. package/dist/index.es115.js +2 -2
  239. package/dist/index.es116.js +2 -2
  240. package/dist/index.es117.js +1 -1
  241. package/dist/index.es121.js +2 -2
  242. package/dist/index.es124.js +1 -1
  243. package/dist/index.es128.js +1 -1
  244. package/dist/index.es131.js +1 -1
  245. package/dist/index.es139.js +1 -1
  246. package/dist/index.es14.js +2 -2
  247. package/dist/index.es140.js +1 -1
  248. package/dist/index.es141.js +1 -1
  249. package/dist/index.es142.js +2 -2
  250. package/dist/index.es143.js +1 -1
  251. package/dist/index.es144.js +1 -1
  252. package/dist/index.es145.js +1 -1
  253. package/dist/index.es147.js +2 -2
  254. package/dist/index.es148.js +2 -2
  255. package/dist/index.es149.js +1 -1
  256. package/dist/index.es15.js +5 -5
  257. package/dist/index.es150.js +1 -1
  258. package/dist/index.es151.js +1 -1
  259. package/dist/index.es152.js +1 -1
  260. package/dist/index.es153.js +2 -2
  261. package/dist/index.es154.js +2 -2
  262. package/dist/index.es155.js +1 -1
  263. package/dist/index.es158.js +2 -2
  264. package/dist/index.es159.js +2 -2
  265. package/dist/index.es16.js +1 -1
  266. package/dist/index.es161.js +2 -2
  267. package/dist/index.es162.js +1 -1
  268. package/dist/index.es163.js +2 -2
  269. package/dist/index.es164.js +1 -1
  270. package/dist/index.es165.js +2 -2
  271. package/dist/index.es166.js +1 -1
  272. package/dist/index.es167.js +1 -1
  273. package/dist/index.es168.js +1 -1
  274. package/dist/index.es174.js +1 -1
  275. package/dist/index.es175.js +2 -2
  276. package/dist/index.es176.js +1 -1
  277. package/dist/index.es177.js +1 -1
  278. package/dist/index.es178.js +1 -1
  279. package/dist/index.es181.js +1 -1
  280. package/dist/index.es182.js +1 -1
  281. package/dist/index.es183.js +1 -1
  282. package/dist/index.es184.js +2 -2
  283. package/dist/index.es19.js +2 -2
  284. package/dist/index.es191.js +7 -7
  285. package/dist/index.es191.js.map +1 -1
  286. package/dist/index.es192.js +147 -4
  287. package/dist/index.es192.js.map +1 -1
  288. package/dist/index.es193.js +12197 -4
  289. package/dist/index.es193.js.map +1 -1
  290. package/dist/index.es194.js +3 -5
  291. package/dist/index.es194.js.map +1 -1
  292. package/dist/index.es195.js +3 -5
  293. package/dist/index.es195.js.map +1 -1
  294. package/dist/index.es196.js +35 -8
  295. package/dist/index.es196.js.map +1 -1
  296. package/dist/index.es197.js +3 -24
  297. package/dist/index.es197.js.map +1 -1
  298. package/dist/index.es198.js +21 -20
  299. package/dist/index.es198.js.map +1 -1
  300. package/dist/index.es199.js +2 -16
  301. package/dist/index.es199.js.map +1 -1
  302. package/dist/index.es200.js +3 -19
  303. package/dist/index.es200.js.map +1 -1
  304. package/dist/index.es201.js +2 -8
  305. package/dist/index.es201.js.map +1 -1
  306. package/dist/index.es202.js +31 -8
  307. package/dist/index.es202.js.map +1 -1
  308. package/dist/index.es203.js +13 -7
  309. package/dist/index.es203.js.map +1 -1
  310. package/dist/index.es204.js +13 -21
  311. package/dist/index.es204.js.map +1 -1
  312. package/dist/index.es205.js +8 -9
  313. package/dist/index.es205.js.map +1 -1
  314. package/dist/index.es206.js +2 -9
  315. package/dist/index.es206.js.map +1 -1
  316. package/dist/index.es207.js +46 -4
  317. package/dist/index.es207.js.map +1 -1
  318. package/dist/index.es208.js +22 -10
  319. package/dist/index.es208.js.map +1 -1
  320. package/dist/index.es209.js +7 -8
  321. package/dist/index.es209.js.map +1 -1
  322. package/dist/index.es21.js +2 -2
  323. package/dist/index.es210.js +4 -22
  324. package/dist/index.es210.js.map +1 -1
  325. package/dist/index.es211.js +4 -12
  326. package/dist/index.es211.js.map +1 -1
  327. package/dist/index.es212.js +3 -19
  328. package/dist/index.es212.js.map +1 -1
  329. package/dist/index.es213.js +3 -4
  330. package/dist/index.es213.js.map +1 -1
  331. package/dist/index.es214.js +8 -17
  332. package/dist/index.es214.js.map +1 -1
  333. package/dist/index.es215.js +20 -10
  334. package/dist/index.es215.js.map +1 -1
  335. package/dist/index.es216.js +21 -3
  336. package/dist/index.es216.js.map +1 -1
  337. package/dist/index.es217.js +13 -4
  338. package/dist/index.es217.js.map +1 -1
  339. package/dist/index.es218.js +16 -7
  340. package/dist/index.es218.js.map +1 -1
  341. package/dist/index.es219.js +5 -147
  342. package/dist/index.es219.js.map +1 -1
  343. package/dist/index.es22.js +2 -2
  344. package/dist/index.es220.js +7 -12195
  345. package/dist/index.es220.js.map +1 -1
  346. package/dist/index.es221.js +9 -3
  347. package/dist/index.es221.js.map +1 -1
  348. package/dist/index.es222.js +24 -3
  349. package/dist/index.es222.js.map +1 -1
  350. package/dist/index.es223.js +8 -34
  351. package/dist/index.es223.js.map +1 -1
  352. package/dist/index.es224.js +11 -3
  353. package/dist/index.es224.js.map +1 -1
  354. package/dist/index.es225.js +4 -23
  355. package/dist/index.es225.js.map +1 -1
  356. package/dist/index.es226.js +13 -2
  357. package/dist/index.es226.js.map +1 -1
  358. package/dist/index.es227.js +11 -3
  359. package/dist/index.es227.js.map +1 -1
  360. package/dist/index.es228.js +25 -2
  361. package/dist/index.es228.js.map +1 -1
  362. package/dist/index.es229.js +10 -30
  363. package/dist/index.es229.js.map +1 -1
  364. package/dist/index.es230.js +19 -13
  365. package/dist/index.es230.js.map +1 -1
  366. package/dist/index.es231.js +4 -14
  367. package/dist/index.es231.js.map +1 -1
  368. package/dist/index.es232.js +17 -8
  369. package/dist/index.es232.js.map +1 -1
  370. package/dist/index.es233.js +12 -2
  371. package/dist/index.es233.js.map +1 -1
  372. package/dist/index.es234.js +3 -45
  373. package/dist/index.es234.js.map +1 -1
  374. package/dist/index.es235.js +4 -22
  375. package/dist/index.es235.js.map +1 -1
  376. package/dist/index.es236.js +1 -1
  377. package/dist/index.es240.js +1 -1
  378. package/dist/index.es243.js +1 -1
  379. package/dist/index.es244.js +1 -1
  380. package/dist/index.es246.js +1 -1
  381. package/dist/index.es249.js +2 -2
  382. package/dist/index.es25.js +1 -1
  383. package/dist/index.es250.js +1 -1
  384. package/dist/index.es251.js +2 -2
  385. package/dist/index.es254.js +1 -1
  386. package/dist/index.es255.js +1 -1
  387. package/dist/index.es257.js +15 -2
  388. package/dist/index.es257.js.map +1 -1
  389. package/dist/index.es258.js +2 -15
  390. package/dist/index.es258.js.map +1 -1
  391. package/dist/index.es259.js +4 -70
  392. package/dist/index.es259.js.map +1 -1
  393. package/dist/index.es260.js +70 -4
  394. package/dist/index.es260.js.map +1 -1
  395. package/dist/index.es27.js +2 -2
  396. package/dist/index.es29.js +2 -2
  397. package/dist/index.es30.js +2 -2
  398. package/dist/index.es31.js +2 -2
  399. package/dist/index.es33.js +1 -1
  400. package/dist/index.es34.js +2 -2
  401. package/dist/index.es35.js +2 -2
  402. package/dist/index.es37.js +1 -1
  403. package/dist/index.es38.js +1 -1
  404. package/dist/index.es39.js +1 -1
  405. package/dist/index.es43.js +2 -2
  406. package/dist/index.es44.js +3 -3
  407. package/dist/index.es45.js +1 -1
  408. package/dist/index.es47.js +1 -1
  409. package/dist/index.es48.js +1 -1
  410. package/dist/index.es50.js +1 -1
  411. package/dist/index.es52.js +5 -5
  412. package/dist/index.es57.js +1 -1
  413. package/dist/index.es59.js +15 -15
  414. package/dist/index.es61.js +1 -1
  415. package/dist/index.es62.js +1 -1
  416. package/dist/index.es63.js +106 -5
  417. package/dist/index.es63.js.map +1 -1
  418. package/dist/index.es64.js +10 -2
  419. package/dist/index.es64.js.map +1 -1
  420. package/dist/index.es65.js +6 -2
  421. package/dist/index.es65.js.map +1 -1
  422. package/dist/index.es66.js +2 -107
  423. package/dist/index.es66.js.map +1 -1
  424. package/dist/index.es67.js +2 -10
  425. package/dist/index.es67.js.map +1 -1
  426. package/dist/index.es68.js +55 -2
  427. package/dist/index.es68.js.map +1 -1
  428. package/dist/index.es69.js +48 -4
  429. package/dist/index.es69.js.map +1 -1
  430. package/dist/index.es70.js +37 -55
  431. package/dist/index.es70.js.map +1 -1
  432. package/dist/index.es71.js +11 -47
  433. package/dist/index.es71.js.map +1 -1
  434. package/dist/index.es72.js +14 -38
  435. package/dist/index.es72.js.map +1 -1
  436. package/dist/index.es73.js +29 -11
  437. package/dist/index.es73.js.map +1 -1
  438. package/dist/index.es74.js +10 -10
  439. package/dist/index.es74.js.map +1 -1
  440. package/dist/index.es75.js +13 -29
  441. package/dist/index.es75.js.map +1 -1
  442. package/dist/index.es76.js +10 -12
  443. package/dist/index.es76.js.map +1 -1
  444. package/dist/index.es77.js +4 -14
  445. package/dist/index.es77.js.map +1 -1
  446. package/dist/index.es78.js +2 -11
  447. package/dist/index.es78.js.map +1 -1
  448. package/dist/index.es80.js +1 -1
  449. package/dist/index.es87.js +1 -1
  450. package/dist/index.es88.js +1 -1
  451. package/dist/index.es89.js +1 -1
  452. package/dist/index.es90.js +1 -1
  453. package/dist/index.es91.js +1 -1
  454. package/dist/index.es92.js +1 -1
  455. package/dist/index.es93.js +1 -1
  456. package/dist/index.es94.js +1 -1
  457. package/dist/index.es95.js +1 -1
  458. package/dist/index.es98.js +1 -1
  459. package/dist/index.es99.js +1 -1
  460. package/dist/style.css +1 -1
  461. package/package.json +1 -1
@@ -1,5 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),r=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(o=o<0?Math.max(r+arguments[2],0):Math.min(o,r);i<o;)e[i]=t,++i;return e},writable:!0});Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)};Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};Number.parseFloat=Number.parseFloat||parseFloat;Number.isNaN=Number.isNaN||function(n){return n!==n};Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var Lr=function(){};Lr.prototype.interfaces_=function(){return[]};Lr.prototype.getClass=function(){return Lr};Lr.prototype.equalsWithTolerance=function(t,e,r){return Math.abs(t-e)<=r};var H=function(n){function t(e){n.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),w=function(){},Ni={MAX_VALUE:{configurable:!0}};w.isNaN=function(t){return Number.isNaN(t)};w.doubleToLongBits=function(t){return t};w.longBitsToDouble=function(t){return t};w.isInfinite=function(t){return!Number.isFinite(t)};Ni.MAX_VALUE.get=function(){return Number.MAX_VALUE};Object.defineProperties(w,Ni);var $t=function(){},Vn=function(){},Xr=function(){};function te(){}var p=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Gr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};p.prototype.setOrdinate=function(t,e){switch(t){case p.X:this.x=e;break;case p.Y:this.y=e;break;case p.Z:this.z=e;break;default:throw new H("Invalid ordinate index: "+t)}};p.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return!(!Lr.equalsWithTolerance(this.x,e.x,r)||!Lr.equalsWithTolerance(this.y,e.y,r))}};p.prototype.getOrdinate=function(t){switch(t){case p.X:return this.x;case p.Y:return this.y;case p.Z:return this.z}throw new H("Invalid ordinate index: "+t)};p.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||w.isNaN(this.z))&&w.isNaN(t.z)};p.prototype.equals=function(t){return t instanceof p?this.equals2D(t):!1};p.prototype.equalInZ=function(t,e){return Lr.equalsWithTolerance(this.z,t.z,e)};p.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};p.prototype.clone=function(){};p.prototype.copy=function(){return new p(this)};p.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};p.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+r*r+i*i)};p.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)};p.prototype.hashCode=function(){var t=17;return t=37*t+p.hashCode(this.x),t=37*t+p.hashCode(this.y),t};p.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z};p.prototype.interfaces_=function(){return[$t,Vn,te]};p.prototype.getClass=function(){return p};p.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=w.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}};Gr.DimensionalComparator.get=function(){return er};Gr.serialVersionUID.get=function(){return 6683108902428367e3};Gr.NULL_ORDINATE.get=function(){return w.NaN};Gr.X.get=function(){return 0};Gr.Y.get=function(){return 1};Gr.Z.get=function(){return 2};Object.defineProperties(p,Gr);var er=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new H("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};er.prototype.compare=function(t,e){var r=t,i=e,o=er.compare(r.x,i.x);if(o!==0)return o;var s=er.compare(r.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=er.compare(r.z,i.z);return a};er.prototype.interfaces_=function(){return[Xr]};er.prototype.getClass=function(){return er};er.compare=function(t,e){return t<e?-1:t>e?1:w.isNaN(t)?w.isNaN(e)?0:-1:w.isNaN(e)?1:0};var Yr=function(){};Yr.prototype.create=function(){};Yr.prototype.interfaces_=function(){return[]};Yr.prototype.getClass=function(){return Yr};var h=function(){},wn={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};h.prototype.interfaces_=function(){return[]};h.prototype.getClass=function(){return h};h.toLocationSymbol=function(t){switch(t){case h.EXTERIOR:return"e";case h.BOUNDARY:return"b";case h.INTERIOR:return"i";case h.NONE:return"-"}throw new H("Unknown location value: "+t)};wn.INTERIOR.get=function(){return 0};wn.BOUNDARY.get=function(){return 1};wn.EXTERIOR.get=function(){return 2};wn.NONE.get=function(){return-1};Object.defineProperties(h,wn);var P=function(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1},qt=function(){},xi={LOG_10:{configurable:!0}};qt.prototype.interfaces_=function(){return[]};qt.prototype.getClass=function(){return qt};qt.log10=function(t){var e=Math.log(t);return w.isInfinite(e)||w.isNaN(e)?e:e/qt.LOG_10};qt.min=function(t,e,r,i){var o=t;return e<o&&(o=e),r<o&&(o=r),i<o&&(o=i),o};qt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],r=arguments[2];return t<e?e:t>r?r:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}};qt.wrap=function(t,e){return t<0?e- -t%e:t%e};qt.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2],i=t;return e>i&&(i=e),r>i&&(i=r),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}};qt.average=function(t,e){return(t+e)/2};xi.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(qt,xi);var we=function(t){this.str=t};we.prototype.append=function(t){this.str+=t};we.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)};we.prototype.toString=function(t){return this.str};var _e=function(t){this.value=t};_e.prototype.intValue=function(){return this.value};_e.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0};_e.isNaN=function(t){return Number.isNaN(t)};var gn=function(){};gn.isWhitespace=function(t){return t<=32&&t>=0||t===127};gn.toUpperCase=function(t){return t.toUpperCase()};var d=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},fe={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}};d.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo};d.prototype.extractSignificantDigits=function(t,e){var r=this.abs(),i=d.magnitude(r._hi),o=d.TEN.pow(i);r=r.divide(o),r.gt(d.TEN)?(r=r.divide(d.TEN),i+=1):r.lt(d.ONE)&&(r=r.multiply(d.TEN),i-=1);for(var s=i+1,a=new we,u=d.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(r._hi);if(c<0)break;var f=!1,g=0;c>9?(f=!0,g="9"):g="0"+c,a.append(g),r=r.subtract(d.valueOf(c)).multiply(d.TEN),f&&r.selfAdd(d.TEN);var m=!0,_=d.magnitude(r._hi);if(_<0&&Math.abs(_)>=u-l&&(m=!1),!m)break}return e[0]=i,a.toString()};d.prototype.sqr=function(){return this.multiply(this)};d.prototype.doubleValue=function(){return this._hi+this._lo};d.prototype.subtract=function(){if(arguments[0]instanceof d){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}};d.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}};d.prototype.isZero=function(){return this._hi===0&&this._lo===0};d.prototype.selfSubtract=function(){if(arguments[0]instanceof d){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}};d.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};d.prototype.min=function(t){return this.le(t)?this:t};d.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,g=null;return l=this._hi/r,c=d.SPLIT*l,o=c-l,g=d.SPLIT*r,o=c-o,s=l-o,a=g-r,f=l*r,a=g-a,u=r-a,g=o*a-f+o*u+s*a+s*u,c=(this._hi-f-g+this._lo-l*i)/r,g=l+c,this._hi=g,this._lo=l-g+c,this}};d.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};d.prototype.divide=function(){if(arguments[0]instanceof d){var t=arguments[0],e=null,r=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=d.SPLIT*s,e=a-s,l=d.SPLIT*t._hi,e=a-e,r=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+r*i+r*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new d(c,f)}else if(typeof arguments[0]=="number"){var g=arguments[0];return w.isNaN(g)?d.createNaN():d.copy(this).selfDivide(g,0)}};d.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo};d.prototype.pow=function(t){if(t===0)return d.valueOf(1);var e=new d(this),r=d.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r};d.prototype.ceil=function(){if(this.isNaN())return d.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new d(t,e)};d.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};d.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()};d.prototype.setValue=function(){if(arguments[0]instanceof d){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}};d.prototype.max=function(t){return this.ge(t)?this:t};d.prototype.sqrt=function(){if(this.isZero())return d.valueOf(0);if(this.isNegative())return d.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=d.valueOf(e),i=this.subtract(r.sqr()),o=i._hi*(t*.5);return r.add(o)};d.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],r=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,r=o+u,i=u+(o-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,g=null,m=null,_=null,E=null,C=null,S=null,A=null;E=this._hi+l,m=this._lo+c,S=E-this._hi,A=m-this._lo,C=E-S,_=m-A,C=l-S+(this._hi-C),_=c-A+(this._lo-_),S=C+m,f=E+S,g=S+(E-f),S=_+g;var F=f+S,Et=S+(f-F);return this._hi=F,this._lo=Et,this}};d.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=d.SPLIT*this._hi,o=l-this._hi,c=d.SPLIT*r,o=l-o,s=this._hi-o,a=c-r,l=this._hi*r,a=c-a,u=r-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*r);var f=l+c;o=l-f;var g=c+o;return this._hi=f,this._lo=g,this}};d.prototype.selfSqr=function(){return this.selfMultiply(this)};d.prototype.floor=function(){if(this.isNaN())return d.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new d(t,e)};d.prototype.negate=function(){return this.isNaN()?this:new d(-this._hi,-this._lo)};d.prototype.clone=function(){};d.prototype.multiply=function(){if(arguments[0]instanceof d){var t=arguments[0];return t.isNaN()?d.createNaN():d.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return w.isNaN(e)?d.createNaN():d.copy(this).selfMultiply(e,0)}};d.prototype.isNaN=function(){return w.isNaN(this._hi)};d.prototype.intValue=function(){return Math.trunc(this._hi)};d.prototype.toString=function(){var t=d.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()};d.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),i=e[0]+1,o=r;if(r.charAt(0)===".")o="0"+r;else if(i<0)o="0."+d.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var s=i-r.length,a=d.stringOfChar("0",s);o=r+a+".0"}return this.isNegative()?"-"+o:o};d.prototype.reciprocal=function(){var t=null,e=null,r=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=d.SPLIT*o,t=s-o,u=d.SPLIT*this._hi,t=s-t,e=o-t,r=u-this._hi,a=o*this._hi,r=u-r,i=this._hi-r,u=t*r-a+t*i+e*r+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new d(l,c)};d.prototype.toSciNotation=function(){if(this.isZero())return d.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),i=d.SCI_NOT_EXPONENT_CHAR+e[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var s=r.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i};d.prototype.abs=function(){return this.isNaN()?d.NaN:this.isNegative()?this.negate():new d(this)};d.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};d.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo};d.prototype.add=function(){if(arguments[0]instanceof d){var t=arguments[0];return d.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return d.copy(this).selfAdd(e)}};d.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof d){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}};d.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo};d.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};d.prototype.trunc=function(){return this.isNaN()?d.NaN:this.isPositive()?this.floor():this.ceil()};d.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};d.prototype.interfaces_=function(){return[te,$t,Vn]};d.prototype.getClass=function(){return d};d.sqr=function(t){return d.valueOf(t).selfMultiply(t)};d.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return d.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new d(e)}};d.sqrt=function(t){return d.valueOf(t).sqrt()};d.parse=function(t){for(var e=0,r=t.length;gn.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<r){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new d,a=0,u=0,l=0;!(e>=r);){var c=t.charAt(e);if(e++,gn.isDigit(c)){var f=c-"0";s.selfMultiply(d.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var g=t.substring(e);try{l=_e.parseInt(g)}catch(S){throw S instanceof Error?new Error("Invalid exponent "+g+" in string "+t):S}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var m=s,_=a-u-l;if(_===0)m=s;else if(_>0){var E=d.TEN.pow(_);m=s.divide(E)}else if(_<0){var C=d.TEN.pow(-_);m=s.multiply(C)}return i?m.negate():m};d.createNaN=function(){return new d(w.NaN,w.NaN)};d.copy=function(t){return new d(t)};d.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(r)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i};d.stringOfChar=function(t,e){for(var r=new we,i=0;i<e;i++)r.append(t);return r.toString()};fe.PI.get=function(){return new d(3.141592653589793,12246467991473532e-32)};fe.TWO_PI.get=function(){return new d(6.283185307179586,24492935982947064e-32)};fe.PI_2.get=function(){return new d(1.5707963267948966,6123233995736766e-32)};fe.E.get=function(){return new d(2.718281828459045,14456468917292502e-32)};fe.NaN.get=function(){return new d(w.NaN,w.NaN)};fe.EPS.get=function(){return 123259516440783e-46};fe.SPLIT.get=function(){return 134217729};fe.MAX_PRINT_DIGITS.get=function(){return 32};fe.TEN.get=function(){return d.valueOf(10)};fe.ONE.get=function(){return d.valueOf(1)};fe.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"};fe.SCI_NOT_ZERO.get=function(){return"0.0E0"};Object.defineProperties(d,fe);var bt=function(){},Si={DP_SAFE_EPSILON:{configurable:!0}};bt.prototype.interfaces_=function(){return[]};bt.prototype.getClass=function(){return bt};bt.orientationIndex=function(t,e,r){var i=bt.orientationIndexFilter(t,e,r);if(i<=1)return i;var o=d.valueOf(e.x).selfAdd(-t.x),s=d.valueOf(e.y).selfAdd(-t.y),a=d.valueOf(r.x).selfAdd(-e.x),u=d.valueOf(r.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()};bt.signOfDet2x2=function(t,e,r,i){var o=t.multiply(i).selfSubtract(e.multiply(r));return o.signum()};bt.intersection=function(t,e,r,i){var o=d.valueOf(i.y).selfSubtract(r.y).selfMultiply(d.valueOf(e.x).selfSubtract(t.x)),s=d.valueOf(i.x).selfSubtract(r.x).selfMultiply(d.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=d.valueOf(i.x).selfSubtract(r.x).selfMultiply(d.valueOf(t.y).selfSubtract(r.y)),l=d.valueOf(i.y).selfSubtract(r.y).selfMultiply(d.valueOf(t.x).selfSubtract(r.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),g=d.valueOf(t.x).selfAdd(d.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),m=d.valueOf(e.x).selfSubtract(t.x).selfMultiply(d.valueOf(t.y).selfSubtract(r.y)),_=d.valueOf(e.y).selfSubtract(t.y).selfMultiply(d.valueOf(t.x).selfSubtract(r.x)),E=m.subtract(_),C=E.selfDivide(a).doubleValue(),S=d.valueOf(r.y).selfAdd(d.valueOf(i.y).selfSubtract(r.y).selfMultiply(C)).doubleValue();return new p(g,S)};bt.orientationIndexFilter=function(t,e,r){var i=null,o=(t.x-r.x)*(e.y-r.y),s=(t.y-r.y)*(e.x-r.x),a=o-s;if(o>0){if(s<=0)return bt.signum(a);i=o+s}else if(o<0){if(s>=0)return bt.signum(a);i=-o-s}else return bt.signum(a);var u=bt.DP_SAFE_EPSILON*i;return a>=u||-a>=u?bt.signum(a):2};bt.signum=function(t){return t>0?1:t<0?-1:0};Si.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(bt,Si);var M=function(){},On={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};On.X.get=function(){return 0};On.Y.get=function(){return 1};On.Z.get=function(){return 2};On.M.get=function(){return 3};M.prototype.setOrdinate=function(t,e,r){};M.prototype.size=function(){};M.prototype.getOrdinate=function(t,e){};M.prototype.getCoordinate=function(){};M.prototype.getCoordinateCopy=function(t){};M.prototype.getDimension=function(){};M.prototype.getX=function(t){};M.prototype.clone=function(){};M.prototype.expandEnvelope=function(t){};M.prototype.copy=function(){};M.prototype.getY=function(t){};M.prototype.toCoordinateArray=function(){};M.prototype.interfaces_=function(){return[Vn]};M.prototype.getClass=function(){return M};Object.defineProperties(M,On);var Li=function(){},ln=function(n){function t(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Li),ht=function(){};ht.arraycopy=function(t,e,r,i,o){for(var s=0,a=e;a<e+o;a++)r[i+s]=t[a],s++};ht.getProperty=function(t){return{"line.separator":`
2
- `}[t]};var re=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],r=arguments[1];this.x=e,this.y=r,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof p&&arguments[1]instanceof p){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],g=arguments[1],m=arguments[2],_=arguments[3],E=f.y-g.y,C=g.x-f.x,S=f.x*g.y-g.x*f.y,A=m.y-_.y,F=_.x-m.x,Et=m.x*_.y-_.x*m.y;this.x=C*Et-F*S,this.y=A*S-E*Et,this.w=E*F-A*C}};re.prototype.getY=function(){var t=this.y/this.w;if(w.isNaN(t)||w.isInfinite(t))throw new ln;return t};re.prototype.getX=function(){var t=this.x/this.w;if(w.isNaN(t)||w.isInfinite(t))throw new ln;return t};re.prototype.getCoordinate=function(){var t=new p;return t.x=this.getX(),t.y=this.getY(),t};re.prototype.interfaces_=function(){return[]};re.prototype.getClass=function(){return re};re.intersection=function(t,e,r,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=r.y-i.y,l=i.x-r.x,c=r.x*i.y-i.x*r.y,f=s*c-l*a,g=u*a-o*c,m=o*l-u*s,_=f/m,E=g/m;if(w.isNaN(_)||w.isInfinite(_)||w.isNaN(E)||w.isInfinite(E))throw new ln;return new p(_,E)};var N=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Pi={serialVersionUID:{configurable:!0}};N.prototype.getArea=function(){return this.getWidth()*this.getHeight()};N.prototype.equals=function(t){if(!(t instanceof N))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()};N.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new N;var e=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new N(e,i,r,o)};N.prototype.isNull=function(){return this._maxx<this._minx};N.prototype.getMaxX=function(){return this._maxx};N.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof p){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof N){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}};N.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof p){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}};N.prototype.getMinY=function(){return this._miny};N.prototype.getMinX=function(){return this._minx};N.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof p){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof N){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}};N.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e};N.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx};N.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};N.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)};N.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};N.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};N.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};N.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e};N.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};N.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof p){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}};N.prototype.centre=function(){return this.isNull()?null:new p((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};N.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof N){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}};N.prototype.getMaxY=function(){return this._maxy};N.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 r=0;return this._maxy<t._miny?r=t._miny-this._maxy:this._miny>t._maxy&&(r=this._miny-t._maxy),e===0?r:r===0?e:Math.sqrt(e*e+r*r)};N.prototype.hashCode=function(){var t=17;return t=37*t+p.hashCode(this._minx),t=37*t+p.hashCode(this._maxx),t=37*t+p.hashCode(this._miny),t=37*t+p.hashCode(this._maxy),t};N.prototype.interfaces_=function(){return[$t,te]};N.prototype.getClass=function(){return N};N.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.x<e.x?t.x:e.x)&&r.x<=(t.x>e.x?t.x:e.x)&&r.y>=(t.y<e.y?t.y:e.y)&&r.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}};Pi.serialVersionUID.get=function(){return 5873921885273102e3};Object.defineProperties(N,Pi);var he={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*$/},zn=function(t){this.geometryFactory=t||new b};zn.prototype.read=function(t){var e,r,i;t=t.replace(/[\n\r]/g," ");var o=he.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=he.emptyTypeStr.exec(t),o[2]=void 0),o&&(r=o[1].toLowerCase(),i=o[2],kr[r]&&(e=kr[r].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e};zn.prototype.write=function(t){return this.extractGeometry(t)};zn.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Xe[e])return null;var r=e.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+Xe[e].apply(this,[t])+")",i};var Xe={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Xe.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Xe.point.apply(e,[t._geometries[i]])+")");return r.join(",")},linestring:function(t){for(var e=this,r=[],i=0,o=t._points._coordinates.length;i<o;++i)r.push(Xe.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},linearring:function(t){for(var e=this,r=[],i=0,o=t._points._coordinates.length;i<o;++i)r.push(Xe.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},multilinestring:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Xe.linestring.apply(e,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var e=this,r=[];r.push("("+Xe.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)r.push("("+Xe.linestring.apply(e,[t._holes[i]])+")");return r.join(",")},multipolygon:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push("("+Xe.polygon.apply(e,[t._geometries[i]])+")");return r.join(",")},geometrycollection:function(t){for(var e=this,r=[],i=0,o=t._geometries.length;i<o;++i)r.push(e.extractGeometry(t._geometries[i]));return r.join(",")}},kr={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(he.spaces);return this.geometryFactory.createPoint(new p(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(he.trimParens,"$1"),o.push(kr.point.apply(e,[r]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),r=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(he.spaces),r.push(new p(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),r=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(he.spaces),r.push(new p(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=t.trim().split(he.parenComma),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(he.trimParens,"$1"),o.push(kr.linestring.apply(e,[r]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var r,i,o,s=t.trim().split(he.parenComma),a,u=[],l=0,c=s.length;l<c;++l)r=s[l].replace(he.trimParens,"$1"),i=kr.linestring.apply(e,[r]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=t.trim().split(he.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)r=i[s].replace(he.trimParens,"$1"),o.push(kr.polygon.apply(e,[r]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=t.trim().split("|"),i=[],o=0,s=r.length;o<s;++o)i.push(e.read(r[o]));return this.geometryFactory.createGeometryCollection(i)}},ie=function(t){this.parser=new zn(t)};ie.prototype.write=function(t){return this.parser.write(t)};ie.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var je=function(n){function t(e){n.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),An=function(n){function t(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var e=arguments[0];n.call(this,e)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(je),D=function(){};D.prototype.interfaces_=function(){return[]};D.prototype.getClass=function(){return D};D.shouldNeverReachHere=function(){if(arguments.length===0)D.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new An("Should never reach here"+(t!==null?": "+t:""))}};D.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],D.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new An:new An(e)};D.equals=function(){var t,e,r;if(arguments.length===2)t=arguments[0],e=arguments[1],D.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],r=arguments[2],!e.equals(t)))throw new An("Expected "+t+" but encountered "+e+(r!==null?": "+r:""))};var W=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 p,this._intPt[1]=new p,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Vr={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};W.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]};W.prototype.getTopologySummary=function(){var t=new we;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()};W.prototype.computeIntersection=function(t,e,r,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,r,i)};W.prototype.getIntersectionNum=function(){return this._result};W.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),r=this.getEdgeDistance(t,1);e>r?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};W.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};W.prototype.setPrecisionModel=function(t){this._precisionModel=t};W.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],r=0;r<this._result;r++)if(!(t._intPt[r].equals2D(t._inputLines[e][0])||t._intPt[r].equals2D(t._inputLines[e][1])))return!0;return!1}};W.prototype.getIntersection=function(t){return this._intPt[t]};W.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};W.prototype.hasIntersection=function(){return this._result!==W.NO_INTERSECTION};W.prototype.getEdgeDistance=function(t,e){var r=W.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return r};W.prototype.isCollinear=function(){return this._result===W.COLLINEAR_INTERSECTION};W.prototype.toString=function(){return ie.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+ie.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()};W.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]};W.prototype.isIntersection=function(t){for(var e=this,r=0;r<this._result;r++)if(e._intPt[r].equals2D(t))return!0;return!1};W.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]};W.prototype.interfaces_=function(){return[]};W.prototype.getClass=function(){return W};W.computeEdgeDistance=function(t,e,r){var i=Math.abs(r.x-e.x),o=Math.abs(r.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(r))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return D.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s};W.nonRobustComputeEdgeDistance=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return D.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s};Vr.DONT_INTERSECT.get=function(){return 0};Vr.DO_INTERSECT.get=function(){return 1};Vr.COLLINEAR.get=function(){return 2};Vr.NO_INTERSECTION.get=function(){return 0};Vr.POINT_INTERSECTION.get=function(){return 1};Vr.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(W,Vr);var Sr=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(r){var i=new N(this._inputLines[0][0],this._inputLines[0][1]),o=new N(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&o.contains(r)},t.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,N.intersects(i,o,r)&&I.orientationIndex(i,o,r)===0&&I.orientationIndex(o,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(o))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(r,i,o,s,a){a.x=this.smallestInAbsValue(r.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(r.y,i.y,o.y,s.y),r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(r,i,o,s){var a=null;try{a=re.intersection(r,i,o,s)}catch(u){if(u instanceof ln)a=t.nearestEndpoint(r,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(r,i,o,s){var a=this.intersectionWithNormalization(r,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new p(t.nearestEndpoint(r,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(r,i,o,s){var a=r,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(r,i,o,s,a){var u=bt.intersection(r,i,o,s),l=this.isInSegmentEnvelopes(u);ht.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&ht.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(r,i,o,s){var a=new p(r),u=new p(i),l=new p(o),c=new p(s),f=new p;this.normalizeToEnvCentre(a,u,l,c,f);var g=this.safeHCoordinateIntersection(a,u,l,c);return g.x+=f.x,g.y+=f.y,g},t.prototype.computeCollinearIntersection=function(r,i,o,s){var a=N.intersects(r,i,o),u=N.intersects(r,i,s),l=N.intersects(o,s,r),c=N.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,n.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!u&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!a&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(r,i,o,s,a){var u=r.x<i.x?r.x:i.x,l=r.y<i.y?r.y:i.y,c=r.x>i.x?r.x:i.x,f=r.y>i.y?r.y:i.y,g=o.x<s.x?o.x:s.x,m=o.y<s.y?o.y:s.y,_=o.x>s.x?o.x:s.x,E=o.y>s.y?o.y:s.y,C=u>g?u:g,S=c<_?c:_,A=l>m?l:m,F=f<E?f:E,Et=(C+S)/2,ee=(A+F)/2;a.x=Et,a.y=ee,r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(r,i,o,s){if(this._isProper=!1,!N.intersects(r,i,o,s))return n.NO_INTERSECTION;var a=I.orientationIndex(r,i,o),u=I.orientationIndex(r,i,s);if(a>0&&u>0||a<0&&u<0)return n.NO_INTERSECTION;var l=I.orientationIndex(o,s,r),c=I.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return n.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(r,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,r.equals2D(o)||r.equals2D(s)?this._intPt[0]=r:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new p(o):u===0?this._intPt[0]=new p(s):l===0?this._intPt[0]=new p(r):c===0&&(this._intPt[0]=new p(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,o,s)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(r,i,o,s){var a=r,u=I.distancePointLine(r,o,s),l=I.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=I.distancePointLine(o,r,i),l<u&&(u=l,a=o),l=I.distancePointLine(s,r,i),l<u&&(u=l,a=s),a},t}(W),Pr=function(){};Pr.prototype.interfaces_=function(){return[]};Pr.prototype.getClass=function(){return Pr};Pr.orientationIndex=function(t,e,r){var i=e.x-t.x,o=e.y-t.y,s=r.x-e.x,a=r.y-e.y;return Pr.signOfDet2x2(i,o,s,a)};Pr.signOfDet2x2=function(t,e,r,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||r===0?0:e>0?r>0?-o:o:r>0?o:-o;if(e===0||r===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=r,r=s,s=e,e=i,i=s):e<=-i?(o=-o,r=-r,i=-i):(s=t,t=-r,r=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=r,r=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,r=-r,i=-i):(o=-o,s=-t,t=-r,r=s,s=-e,e=-i,i=s),t>0)if(r>0){if(!(t<=r))return o}else return o;else{if(r>0)return-o;if(t>=r)o=-o,t=-t,r=-r;else return-o}for(;;){if(a=Math.floor(r/t),r=r-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>r+r){if(e<i+i)return o}else{if(e>i+i)return-o;r=t-r,i=e-i,o=-o}if(i===0)return r===0?0:-o;if(r===0||(a=Math.floor(t/r),t=t-a*r,e=e-a*i,e<0))return o;if(e>i)return-o;if(r>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=r-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var me=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};me.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 r=t.x,i=e.x;return r>i&&(r=e.x,i=t.x),this._p.x>=r&&this._p.x<=i&&(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 o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=Pr.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}};me.prototype.isPointInPolygon=function(){return this.getLocation()!==h.EXTERIOR};me.prototype.getLocation=function(){return this._isPointOnSegment?h.BOUNDARY:this._crossingCount%2===1?h.INTERIOR:h.EXTERIOR};me.prototype.isOnSegment=function(){return this._isPointOnSegment};me.prototype.interfaces_=function(){return[]};me.prototype.getClass=function(){return me};me.locatePointInRing=function(){if(arguments[0]instanceof p&&P(arguments[1],M)){for(var t=arguments[0],e=arguments[1],r=new me(t),i=new p,o=new p,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),r.countSegment(i,o),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof p&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new me(a),c=1;c<u.length;c++){var f=u[c],g=u[c-1];if(l.countSegment(f,g),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var I=function(){},zr={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};I.prototype.interfaces_=function(){return[]};I.prototype.getClass=function(){return I};I.orientationIndex=function(t,e,r){return bt.orientationIndex(t,e,r)};I.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,r=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-r,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(P(arguments[0],M)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new p,f=new p,g=new p;u.getCoordinate(0,f),u.getCoordinate(1,g);var m=f.x;g.x-=m;for(var _=0,E=1;E<l-1;E++)c.y=f.y,f.x=g.x,f.y=g.y,u.getCoordinate(E+1,g),g.x-=m,_+=f.x*(c.y-g.y);return _/2}};I.distanceLineLine=function(t,e,r,i){if(t.equals(e))return I.distancePointLine(t,r,i);if(r.equals(i))return I.distancePointLine(i,t,e);var o=!1;if(!N.intersects(t,e,r,i))o=!0;else{var s=(e.x-t.x)*(i.y-r.y)-(e.y-t.y)*(i.x-r.x);if(s===0)o=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?qt.min(I.distancePointLine(t,r,i),I.distancePointLine(e,r,i),I.distancePointLine(r,t,e),I.distancePointLine(i,t,e)):0};I.isPointInRing=function(t,e){return I.locatePointInRing(t,e)!==h.EXTERIOR};I.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,i=new p;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;r+=Math.sqrt(c*c+f*f),o=u,s=l}return r};I.isCCW=function(t){var e=t.length-1;if(e<3)throw new H("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>r.y&&(r=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(r)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(r)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(r)||c.equals2D(r)||l.equals2D(c))return!1;var f=I.computeOrientation(l,r,c),g=!1;return f===0?g=l.x>c.x:g=f>0,g};I.locatePointInRing=function(t,e){return me.locatePointInRing(t,e)};I.distancePointLinePerpendicular=function(t,e,r){var i=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),o=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)};I.computeOrientation=function(t,e,r){return I.orientationIndex(t,e,r)};I.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new H("Line array must contain at least one vertex");for(var r=t.distance(e[0]),i=0;i<e.length-1;i++){var o=I.distancePointLine(t,e[i],e[i+1]);o<r&&(r=o)}return r}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}};I.isOnLine=function(t,e){for(var r=new Sr,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(r.computeIntersection(t,o,s),r.hasIntersection())return!0}return!1};zr.CLOCKWISE.get=function(){return-1};zr.RIGHT.get=function(){return I.CLOCKWISE};zr.COUNTERCLOCKWISE.get=function(){return 1};zr.LEFT.get=function(){return I.COUNTERCLOCKWISE};zr.COLLINEAR.get=function(){return 0};zr.STRAIGHT.get=function(){return I.COLLINEAR};Object.defineProperties(I,zr);var Ke=function(){};Ke.prototype.filter=function(t){};Ke.prototype.interfaces_=function(){return[]};Ke.prototype.getClass=function(){return Ke};var L=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},qe={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}};L.prototype.isGeometryCollection=function(){return this.getSortIndex()===L.SORTINDEX_GEOMETRYCOLLECTION};L.prototype.getFactory=function(){return this._factory};L.prototype.getGeometryN=function(t){return this};L.prototype.getArea=function(){return 0};L.prototype.isRectangle=function(){return!1};L.prototype.equals=function(){if(arguments[0]instanceof L){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof L))return!1;var r=e;return this.equalsExact(r)}};L.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)};L.prototype.geometryChanged=function(){this.apply(L.geometryChangedFilter)};L.prototype.geometryChangedAction=function(){this._envelope=null};L.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())};L.prototype.getLength=function(){return 0};L.prototype.getNumGeometries=function(){return 1};L.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}};L.prototype.getUserData=function(){return this._userData};L.prototype.getSRID=function(){return this._SRID};L.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};L.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===L.SORTINDEX_GEOMETRYCOLLECTION)throw new H("This method does not support GeometryCollection arguments")};L.prototype.equal=function(t,e,r){return r===0?t.equals(e):t.distance(e)<=r};L.prototype.norm=function(){var t=this.copy();return t.normalize(),t};L.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()};L.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new N(this._envelope)};L.prototype.setSRID=function(t){this._SRID=t};L.prototype.setUserData=function(t){this._userData=t};L.prototype.compare=function(t,e){for(var r=t.iterator(),i=e.iterator();r.hasNext()&&i.hasNext();){var o=r.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return r.hasNext()?1:i.hasNext()?-1:0};L.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()};L.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===L.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===L.SORTINDEX_MULTIPOINT||this.getSortIndex()===L.SORTINDEX_MULTILINESTRING||this.getSortIndex()===L.SORTINDEX_MULTIPOLYGON};L.prototype.interfaces_=function(){return[Vn,$t,te]};L.prototype.getClass=function(){return L};L.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1};L.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1};qe.serialVersionUID.get=function(){return 8763622679187377e3};qe.SORTINDEX_POINT.get=function(){return 0};qe.SORTINDEX_MULTIPOINT.get=function(){return 1};qe.SORTINDEX_LINESTRING.get=function(){return 2};qe.SORTINDEX_LINEARRING.get=function(){return 3};qe.SORTINDEX_MULTILINESTRING.get=function(){return 4};qe.SORTINDEX_POLYGON.get=function(){return 5};qe.SORTINDEX_MULTIPOLYGON.get=function(){return 6};qe.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7};qe.geometryChangedFilter.get=function(){return ti};Object.defineProperties(L,qe);var ti=function(){};ti.interfaces_=function(){return[Ke]};ti.filter=function(t){t.geometryChangedAction()};var Te=function(){};Te.prototype.filter=function(t){};Te.prototype.interfaces_=function(){return[]};Te.prototype.getClass=function(){return Te};var Jt=function(){},$e={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}};Jt.prototype.isInBoundary=function(t){};Jt.prototype.interfaces_=function(){return[]};Jt.prototype.getClass=function(){return Jt};$e.Mod2BoundaryNodeRule.get=function(){return Hr};$e.EndPointBoundaryNodeRule.get=function(){return Wr};$e.MultiValentEndPointBoundaryNodeRule.get=function(){return jr};$e.MonoValentEndPointBoundaryNodeRule.get=function(){return Kr};$e.MOD2_BOUNDARY_RULE.get=function(){return new Hr};$e.ENDPOINT_BOUNDARY_RULE.get=function(){return new Wr};$e.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new jr};$e.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Kr};$e.OGC_SFS_BOUNDARY_RULE.get=function(){return Jt.MOD2_BOUNDARY_RULE};Object.defineProperties(Jt,$e);var Hr=function(){};Hr.prototype.isInBoundary=function(t){return t%2===1};Hr.prototype.interfaces_=function(){return[Jt]};Hr.prototype.getClass=function(){return Hr};var Wr=function(){};Wr.prototype.isInBoundary=function(t){return t>0};Wr.prototype.interfaces_=function(){return[Jt]};Wr.prototype.getClass=function(){return Wr};var jr=function(){};jr.prototype.isInBoundary=function(t){return t>1};jr.prototype.interfaces_=function(){return[Jt]};jr.prototype.getClass=function(){return jr};var Kr=function(){};Kr.prototype.isInBoundary=function(t){return t===1};Kr.prototype.interfaces_=function(){return[Jt]};Kr.prototype.getClass=function(){return Kr};var it=function(){};it.prototype.add=function(){};it.prototype.addAll=function(){};it.prototype.isEmpty=function(){};it.prototype.iterator=function(){};it.prototype.size=function(){};it.prototype.toArray=function(){};it.prototype.remove=function(){};function ei(n){this.message=n||""}ei.prototype=new Error;ei.prototype.name="IndexOutOfBoundsException";var cn=function(){};cn.prototype.hasNext=function(){};cn.prototype.next=function(){};cn.prototype.remove=function(){};var ne=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(it);function fn(n){this.message=n||""}fn.prototype=new Error;fn.prototype.name="NoSuchElementException";var y=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof it&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[n,it]},t.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(r){for(var i=this,o=r.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(r,i){var o=this.array_[r];return this.array_[r]=i,o},t.prototype.iterator=function(){return new to(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new ei;return this.array_[r]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var r=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(r.array_[o]);return i},t.prototype.remove=function(r){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===r){i.array_.splice(s,1),o=!0;break}return o},t}(ne),to=function(n){function t(e){n.call(this),this.arrayList_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new fn;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(cn),Dn=function(n){function t(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=n.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];n.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof p&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}n.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],g=arguments[1];return this.add(f,g),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var m=arguments[0],_=arguments[1],E=arguments[2];if(E)for(var C=0;C<m.length;C++)i.add(m[C],_);else for(var S=m.length-1;S>=0;S--)i.add(m[S],_);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof p){var A=arguments[0],F=arguments[1],Et=arguments[2];if(!Et){var ee=this.size();if(ee>0){if(A>0){var Ji=this.get(A-1);if(Ji.equals2D(F))return null}if(A<ee){var Qi=this.get(A);if(Qi.equals2D(F))return null}}}n.prototype.add.call(this,A,F)}}else if(arguments.length===4){var Zi=arguments[0],$i=arguments[1],mi=arguments[2],vi=arguments[3],_i=1;mi>vi&&(_i=-1);for(var Qn=mi;Qn!==vi;Qn+=_i)i.add(Zi[Qn],$i);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new p(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(y),R=function(){},Un={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Un.ForwardComparator.get=function(){return dn};Un.BidirectionalComparator.get=function(){return Jr};Un.coordArrayType.get=function(){return new Array(0).fill(null)};R.prototype.interfaces_=function(){return[]};R.prototype.getClass=function(){return R};R.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};R.ptNotInList=function(t,e){for(var r=0;r<t.length;r++){var i=t[r];if(R.indexOf(i,e)<0)return i}return null};R.scroll=function(t,e){var r=R.indexOf(e,t);if(r<0)return null;var i=new Array(t.length).fill(null);ht.arraycopy(t,r,i,0,t.length-r),ht.arraycopy(t,0,i,t.length-r,r),ht.arraycopy(i,0,t,0,t.length)};R.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(e[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}};R.intersection=function(t,e){for(var r=new Dn,i=0;i<t.length;i++)e.intersects(t[i])&&r.add(t[i],!0);return r.toCoordinateArray()};R.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1};R.removeRepeatedPoints=function(t){if(!R.hasRepeatedPoints(t))return t;var e=new Dn(t,!1);return e.toCoordinateArray()};R.reverse=function(t){for(var e=t.length-1,r=Math.trunc(e/2),i=0;i<=r;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}};R.removeNull=function(t){for(var e=0,r=0;r<t.length;r++)t[r]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i};R.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),r=0;r<t.length;r++)e[r]=new p(t[r]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new p(i[o+l])};R.isEqualReversed=function(t,e){for(var r=0;r<t.length;r++){var i=t[r],o=e[t.length-r-1];if(i.compareTo(o)!==0)return!1}return!0};R.envelope=function(t){for(var e=new N,r=0;r<t.length;r++)e.expandToInclude(t[r]);return e};R.toCoordinateArray=function(t){return t.toArray(R.coordArrayType)};R.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]};R.indexOf=function(t,e){for(var r=0;r<e.length;r++)if(t.equals(e[r]))return r;return-1};R.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var r=t.length-1-e,i=t[e].compareTo(t[r]);if(i!==0)return i}return 1};R.compare=function(t,e){for(var r=0;r<t.length&&r<e.length;){var i=t[r].compareTo(e[r]);if(i!==0)return i;r++}return r<e.length?-1:r<t.length?1:0};R.minCoordinate=function(t){for(var e=null,r=0;r<t.length;r++)(e===null||e.compareTo(t[r])>0)&&(e=t[r]);return e};R.extract=function(t,e,r){e=qt.clamp(e,0,t.length),r=qt.clamp(r,-1,t.length);var i=r-e+1;r<0&&(i=0),e>=t.length&&(i=0),r<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=r;a++)o[s++]=t[a];return o};Object.defineProperties(R,Un);var dn=function(){};dn.prototype.compare=function(t,e){var r=t,i=e;return R.compare(r,i)};dn.prototype.interfaces_=function(){return[Xr]};dn.prototype.getClass=function(){return dn};var Jr=function(){};Jr.prototype.compare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var o=R.compare(r,i),s=R.isEqualReversed(r,i);return s?0:o};Jr.prototype.OLDcompare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var o=R.increasingDirection(r),s=R.increasingDirection(i),a=o>0?0:r.length-1,u=s>0?0:r.length-1,l=0;l<r.length;l++){var c=r[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0};Jr.prototype.interfaces_=function(){return[Xr]};Jr.prototype.getClass=function(){return Jr};var Ur=function(){};Ur.prototype.get=function(){};Ur.prototype.put=function(){};Ur.prototype.size=function(){};Ur.prototype.values=function(){};Ur.prototype.entrySet=function(){};var eo=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Ur);function bn(n){this.message=n||""}bn.prototype=new Error;bn.prototype.name="OperationNotSupported";function qn(){}qn.prototype=new it;qn.prototype.contains=function(){};var ri=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof it&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(r){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===r)return!0}return!1},t.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},t.prototype.addAll=function(r){for(var i=this,o=r.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(r){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var r=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(r.array_[o]);return i},t.prototype.iterator=function(){return new ro(this)},t}(qn),ro=function(n){function t(e){n.call(this),this.hashSet_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new fn;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new bn},t}(cn),He=0,hr=1;function yi(n){return n===null?He:n.color}function k(n){return n===null?null:n.parent}function ke(n,t){n!==null&&(n.color=t)}function Zn(n){return n===null?null:n.left}function Ii(n){return n===null?null:n.right}function _t(){this.root_=null,this.size_=0}_t.prototype=new eo;_t.prototype.get=function(n){for(var t=this.root_;t!==null;){var e=n.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null};_t.prototype.put=function(n,t){if(this.root_===null)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:He,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,r,i;do if(r=e,i=n.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:n,left:null,right:null,value:t,parent:r,color:He,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=s:r.right=s,this.fixAfterInsertion(s),this.size_++,null};_t.prototype.fixAfterInsertion=function(n){var t=this;for(n.color=hr;n!=null&&n!==this.root_&&n.parent.color===hr;)if(k(n)===Zn(k(k(n)))){var e=Ii(k(k(n)));yi(e)===hr?(ke(k(n),He),ke(e,He),ke(k(k(n)),hr),n=k(k(n))):(n===Ii(k(n))&&(n=k(n),t.rotateLeft(n)),ke(k(n),He),ke(k(k(n)),hr),t.rotateRight(k(k(n))))}else{var r=Zn(k(k(n)));yi(r)===hr?(ke(k(n),He),ke(r,He),ke(k(k(n)),hr),n=k(k(n))):(n===Zn(k(n))&&(n=k(n),t.rotateRight(n)),ke(k(n),He),ke(k(k(n)),hr),t.rotateLeft(k(k(n))))}this.root_.color=He};_t.prototype.values=function(){var n=new y,t=this.getFirstEntry();if(t!==null)for(n.add(t.value);(t=_t.successor(t))!==null;)n.add(t.value);return n};_t.prototype.entrySet=function(){var n=new ri,t=this.getFirstEntry();if(t!==null)for(n.add(t);(t=_t.successor(t))!==null;)n.add(t);return n};_t.prototype.rotateLeft=function(n){if(n!=null){var t=n.right;n.right=t.left,t.left!=null&&(t.left.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.left===n?n.parent.left=t:n.parent.right=t,t.left=n,n.parent=t}};_t.prototype.rotateRight=function(n){if(n!=null){var t=n.left;n.left=t.right,t.right!=null&&(t.right.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.right===n?n.parent.right=t:n.parent.left=t,t.right=n,n.parent=t}};_t.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n};_t.successor=function(n){if(n===null)return null;if(n.right!==null){for(var t=n.right;t.left!==null;)t=t.left;return t}else{for(var e=n.parent,r=n;e!==null&&r===e.right;)r=e,e=e.parent;return e}};_t.prototype.size=function(){return this.size_};var mn=function(){};mn.prototype.interfaces_=function(){return[]};mn.prototype.getClass=function(){return mn};function wi(){}wi.prototype=new qn;function ye(){this.array_=[],arguments[0]instanceof it&&this.addAll(arguments[0])}ye.prototype=new wi;ye.prototype.contains=function(n){for(var t=this,e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===0)return!0}return!1};ye.prototype.add=function(n){var t=this;if(this.contains(n))return!1;for(var e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===1)return t.array_.splice(e,0,n),!0}return this.array_.push(n),!0};ye.prototype.addAll=function(n){for(var t=this,e=n.iterator();e.hasNext();)t.add(e.next());return!0};ye.prototype.remove=function(n){throw new bn};ye.prototype.size=function(){return this.array_.length};ye.prototype.isEmpty=function(){return this.array_.length===0};ye.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t};ye.prototype.iterator=function(){return new kn(this)};var kn=function(n){this.treeSet_=n,this.position_=0};kn.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new fn;return this.treeSet_.array_[this.position_++]};kn.prototype.hasNext=function(){return this.position_<this.treeSet_.size()};kn.prototype.remove=function(){throw new bn};var gr=function(){};gr.sort=function(){var t=arguments[0],e,r,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){r=t.slice(arguments[1],arguments[2]),r.sort();var s=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(r=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},r.sort(o),s=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])};gr.asList=function(t){for(var e=new y,r=0,i=t.length;r<i;r++)e.add(t[r]);return e};var B=function(){},pe={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}};pe.P.get=function(){return 0};pe.L.get=function(){return 1};pe.A.get=function(){return 2};pe.FALSE.get=function(){return-1};pe.TRUE.get=function(){return-2};pe.DONTCARE.get=function(){return-3};pe.SYM_FALSE.get=function(){return"F"};pe.SYM_TRUE.get=function(){return"T"};pe.SYM_DONTCARE.get=function(){return"*"};pe.SYM_P.get=function(){return"0"};pe.SYM_L.get=function(){return"1"};pe.SYM_A.get=function(){return"2"};B.prototype.interfaces_=function(){return[]};B.prototype.getClass=function(){return B};B.toDimensionSymbol=function(t){switch(t){case B.FALSE:return B.SYM_FALSE;case B.TRUE:return B.SYM_TRUE;case B.DONTCARE:return B.SYM_DONTCARE;case B.P:return B.SYM_P;case B.L:return B.SYM_L;case B.A:return B.SYM_A}throw new H("Unknown dimension value: "+t)};B.toDimensionValue=function(t){switch(gn.toUpperCase(t)){case B.SYM_FALSE:return B.FALSE;case B.SYM_TRUE:return B.TRUE;case B.SYM_DONTCARE:return B.DONTCARE;case B.SYM_P:return B.P;case B.SYM_L:return B.L;case B.SYM_A:return B.A}throw new H("Unknown dimension symbol: "+t)};Object.defineProperties(B,pe);var Ie=function(){};Ie.prototype.filter=function(t){};Ie.prototype.interfaces_=function(){return[]};Ie.prototype.getClass=function(){return Ie};var oe=function(){};oe.prototype.filter=function(t,e){};oe.prototype.isDone=function(){};oe.prototype.isGeometryChanged=function(){};oe.prototype.interfaces_=function(){return[]};oe.prototype.getClass=function(){return oe};var Lt=function(n){function t(r,i){if(n.call(this,i),this._geometries=r||[],n.hasNullElements(this._geometries))throw new H("geometries must not contain null elements")}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new N,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();gr.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=B.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=B.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new ye(gr.asList(this._geometries)),a=new ye(gr.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),g=c.getNumGeometries(),m=0;m<f&&m<g;){var _=i.getGeometryN(m),E=c.getGeometryN(m),C=_.compareToSameClass(E,l);if(C!==0)return C;m++}return m<f?1:m<g?-1:0}},t.prototype.apply=function(){var i=this;if(P(arguments[0],Te))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(P(arguments[0],oe)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(P(arguments[0],Ie)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(P(arguments[0],Ke)){var f=arguments[0];f.filter(this);for(var g=0;g<this._geometries.length;g++)i._geometries[g].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),D.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=n.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(L),mr=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return L.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?B.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Wt(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[mn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(Lt),Wt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Jt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};Wt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)};Wt.prototype.getBoundary=function(){return this._geom instanceof K?this.boundaryLineString(this._geom):this._geom instanceof mr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()};Wt.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])};Wt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()};Wt.prototype.computeBoundaryCoordinates=function(t){var e=this,r=new y;this._endpointMap=new _t;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&r.add(a.getKey())}return R.toCoordinateArray(r)};Wt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Fn,this._endpointMap.put(t,e)),e.count++};Wt.prototype.interfaces_=function(){return[]};Wt.prototype.getClass=function(){return Wt};Wt.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Wt(t);return e.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=new Wt(r,i);return o.getBoundary()}};var Fn=function(){this.count=null};Fn.prototype.interfaces_=function(){return[]};Fn.prototype.getClass=function(){return Fn};function no(){}function io(){}var oo=function(){};function so(){}function ao(){}function uo(){}var jt=function(){},ni={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};jt.prototype.interfaces_=function(){return[]};jt.prototype.getClass=function(){return jt};jt.chars=function(t,e){for(var r=new Array(e).fill(null),i=0;i<e;i++)r[i]=t;return String(r)};jt.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new so,r=new no;return t.printStackTrace(r),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new io(jt.getStackTrace(i));for(var a=new uo,u=0;u<o;u++)try{s+=a.readLine()+jt.NEWLINE}catch(l){if(l instanceof ao)D.shouldNeverReachHere();else throw l}finally{}return s}};jt.split=function(t,e){for(var r=e.length,i=new y,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+r),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u};jt.toString=function(){if(arguments.length===1){var t=arguments[0];return jt.SIMPLE_ORDINATE_FORMAT.format(t)}};jt.spaces=function(t){return jt.chars(" ",t)};ni.NEWLINE.get=function(){return ht.getProperty("line.separator")};ni.SIMPLE_ORDINATE_FORMAT.get=function(){return new oo};Object.defineProperties(jt,ni);var $=function(){};$.prototype.interfaces_=function(){return[]};$.prototype.getClass=function(){return $};$.copyCoord=function(t,e,r,i){for(var o=Math.min(t.getDimension(),r.getDimension()),s=0;s<o;s++)r.setOrdinate(i,s,t.getOrdinate(e,s))};$.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,M.X)===t.getOrdinate(e-1,M.X)&&t.getOrdinate(0,M.Y)===t.getOrdinate(e-1,M.Y)};$.isEqual=function(t,e){var r=t.size(),i=e.size();if(r!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<r;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(w.isNaN(u)&&w.isNaN(l)))return!1}return!0};$.extend=function(t,e,r){var i=t.create(r,e.getDimension()),o=e.size();if($.copy(e,0,i,0,o),o>0)for(var s=o;s<r;s++)$.copy(e,o-1,i,s,1);return i};$.reverse=function(t){for(var e=t.size()-1,r=Math.trunc(e/2),i=0;i<=r;i++)$.swap(t,i,e-i)};$.swap=function(t,e,r){if(e===r)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(r,i)),t.setOrdinate(r,i,o)}};$.copy=function(t,e,r,i,o){for(var s=0;s<o;s++)$.copyCoord(t,e+s,r,i+s)};$.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var r=t.getDimension(),i=new we;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<r;s++)s>0&&i.append(","),i.append(jt.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}};$.ensureValidRing=function(t,e){var r=e.size();if(r===0)return e;if(r<=3)return $.createClosedRing(t,e,4);var i=e.getOrdinate(0,M.X)===e.getOrdinate(r-1,M.X)&&e.getOrdinate(0,M.Y)===e.getOrdinate(r-1,M.Y);return i?e:$.createClosedRing(t,e,r+1)};$.createClosedRing=function(t,e,r){var i=t.create(r,e.getDimension()),o=e.size();$.copy(e,0,i,0,o);for(var s=o;s<r;s++)$.copy(e,0,i,s,1);return i};var K=function(n){function t(r,i){n.call(this,i),this._points=null,this.init(r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new N:this._points.expandEnvelope(new N)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&$.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?B.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return I.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();$.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],g=c;return f.compare(this._points,g._points)}},t.prototype.apply=function(){var i=this;if(P(arguments[0],Te))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(P(arguments[0],oe)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(P(arguments[0],Ie)){var l=arguments[0];l.filter(this)}else if(P(arguments[0],Ke)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Wt(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new H("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[mn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(L),vn=function(){};vn.prototype.interfaces_=function(){return[]};vn.prototype.getClass=function(){return vn};var Ft=function(n){function t(r,i){n.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new N;var i=new N;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return B.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(P(arguments[0],Te)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(P(arguments[0],oe)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(P(arguments[0],Ie)){var s=arguments[0];s.filter(this)}else if(P(arguments[0],Ke)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),D.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[vn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(L),ir=function(){};ir.prototype.interfaces_=function(){return[]};ir.prototype.getClass=function(){return ir};var st=function(n){function t(r,i,o){if(n.call(this,o),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),n.hasNullElements(i))throw new H("holes must not contain null elements");if(r.isEmpty()&&n.hasNonEmptyElements(i))throw new H("shell is empty but holes are not");this._shell=r,this._holes=i}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(I.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(I.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var g=i.getX(f),m=i.getY(f),_=g!==l,E=m!==c;if(_===E)return!1;l=g,c=m}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);gr.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);ht.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=R.minCoordinate(s.getCoordinates());R.scroll(u,l),ht.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],I.isCCW(s.getCoordinates())===a&&R.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,g=c._shell,m=f.compareToSameClass(g,l);if(m!==0)return m;for(var _=this.getNumInteriorRing(),E=c.getNumInteriorRing(),C=0;C<_&&C<E;){var S=i.getInteriorRingN(C),A=c.getInteriorRingN(C),F=S.compareToSameClass(A,l);if(F!==0)return F;C++}return C<_?1:C<E?-1:0}},t.prototype.apply=function(i){var o=this;if(P(i,Te)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(P(i,oe)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(P(i,Ie))i.filter(this);else if(P(i,Ke)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=n.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[ir]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(L),Qr=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return L.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return B.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[vn]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(Lt),Me=function(n){function t(r,i){r instanceof p&&i instanceof b&&(r=i.getCoordinateSequenceFactory().create(r)),n.call(this,r,i),this.validateConstruction()}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return L.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return B.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();$.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new H("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new H("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(K),be=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return L.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,o):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new y,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[ir]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(Lt),Qt=function(t){this._factory=t||null,this._isUserDataCopied=!1},Xn={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Qt.prototype.setCopyUserData=function(t){this._isUserDataCopied=t};Qt.prototype.edit=function(t,e){if(t===null)return null;var r=this.editInternal(t,e);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r};Qt.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof Lt?this.editGeometryCollection(t,e):t instanceof st?this.editPolygon(t,e):t instanceof Ft?e.edit(t,this._factory):t instanceof K?e.edit(t,this._factory):(D.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)};Qt.prototype.editGeometryCollection=function(t,e){for(var r=this,i=e.edit(t,this._factory),o=new y,s=0;s<i.getNumGeometries();s++){var a=r.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Qr?this._factory.createMultiPoint(o.toArray([])):i.getClass()===mr?this._factory.createMultiLineString(o.toArray([])):i.getClass()===be?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))};Qt.prototype.editPolygon=function(t,e){var r=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new y,a=0;a<i.getNumInteriorRing();a++){var u=r.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))};Qt.prototype.interfaces_=function(){return[]};Qt.prototype.getClass=function(){return Qt};Qt.GeometryEditorOperation=function(){};Xn.NoOpGeometryOperation.get=function(){return _n};Xn.CoordinateOperation.get=function(){return yn};Xn.CoordinateSequenceOperation.get=function(){return In};Object.defineProperties(Qt,Xn);var _n=function(){};_n.prototype.edit=function(t,e){return t};_n.prototype.interfaces_=function(){return[Qt.GeometryEditorOperation]};_n.prototype.getClass=function(){return _n};var yn=function(){};yn.prototype.edit=function(t,e){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof Me?e.createLinearRing(r):t instanceof K?e.createLineString(r):t instanceof Ft?r.length>0?e.createPoint(r[0]):e.createPoint():t};yn.prototype.interfaces_=function(){return[Qt.GeometryEditorOperation]};yn.prototype.getClass=function(){return yn};var In=function(){};In.prototype.edit=function(t,e){return t instanceof Me?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof K?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ft?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t};In.prototype.interfaces_=function(){return[Qt.GeometryEditorOperation]};In.prototype.getClass=function(){return In};var Q=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var r=0;r<e;r++)t._coordinates[r]=new p}else if(P(arguments[0],M)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new p}}},Oi={serialVersionUID:{configurable:!0}};Q.prototype.setOrdinate=function(t,e,r){switch(e){case M.X:this._coordinates[t].x=r;break;case M.Y:this._coordinates[t].y=r;break;case M.Z:this._coordinates[t].z=r;break;default:throw new H("invalid ordinateIndex")}};Q.prototype.size=function(){return this._coordinates.length};Q.prototype.getOrdinate=function(t,e){switch(e){case M.X:return this._coordinates[t].x;case M.Y:return this._coordinates[t].y;case M.Z:return this._coordinates[t].z}return w.NaN};Q.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],r=arguments[1];r.x=this._coordinates[e].x,r.y=this._coordinates[e].y,r.z=this._coordinates[e].z}};Q.prototype.getCoordinateCopy=function(t){return new p(this._coordinates[t])};Q.prototype.getDimension=function(){return this._dimension};Q.prototype.getX=function(t){return this._coordinates[t].x};Q.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].clone();return new Q(e,this._dimension)};Q.prototype.expandEnvelope=function(t){for(var e=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(e._coordinates[r]);return t};Q.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].copy();return new Q(e,this._dimension)};Q.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new we(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)e.append(", "),e.append(t._coordinates[r]);return e.append(")"),e.toString()}else return"()"};Q.prototype.getY=function(t){return this._coordinates[t].y};Q.prototype.toCoordinateArray=function(){return this._coordinates};Q.prototype.interfaces_=function(){return[M,te]};Q.prototype.getClass=function(){return Q};Oi.serialVersionUID.get=function(){return-0xcb44a778db18e00};Object.defineProperties(Q,Oi);var Ae=function(){},ii={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ae.prototype.readResolve=function(){return Ae.instance()};Ae.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Q(t)}else if(P(arguments[0],M)){var e=arguments[0];return new Q(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new Q(r):new Q(r,i)}};Ae.prototype.interfaces_=function(){return[Yr,te]};Ae.prototype.getClass=function(){return Ae};Ae.instance=function(){return Ae.instanceObject};ii.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};ii.instanceObject.get=function(){return new Ae};Object.defineProperties(Ae,ii);var Di=function(n){function t(){n.call(this),this.map_=new Map}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(r){return this.map_.get(r)||null},t.prototype.put=function(r,i){return this.map_.set(r,i),i},t.prototype.values=function(){for(var r=new y,i=this.map_.values(),o=i.next();!o.done;)r.add(o.value),o=i.next();return r},t.prototype.entrySet=function(){var r=new ri;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(Ur),V=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Ee){var t=arguments[0];this._modelType=t,t===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=n.FIXED,this.setScale(e)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},oi={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};V.prototype.equals=function(t){if(!(t instanceof V))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale};V.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new _e(r).compareTo(new _e(i))};V.prototype.getScale=function(){return this._scale};V.prototype.isFloating=function(){return this._modelType===V.FLOATING||this._modelType===V.FLOATING_SINGLE};V.prototype.getType=function(){return this._modelType};V.prototype.toString=function(){var t="UNKNOWN";return this._modelType===V.FLOATING?t="Floating":this._modelType===V.FLOATING_SINGLE?t="Floating-Single":this._modelType===V.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};V.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(w.isNaN(t))return t;if(this._modelType===V.FLOATING_SINGLE){var e=t;return e}return this._modelType===V.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof p){var r=arguments[0];if(this._modelType===V.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}};V.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===V.FLOATING?t=16:this._modelType===V.FLOATING_SINGLE?t=6:this._modelType===V.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};V.prototype.setScale=function(t){this._scale=Math.abs(t)};V.prototype.interfaces_=function(){return[te,$t]};V.prototype.getClass=function(){return V};V.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e};oi.serialVersionUID.get=function(){return 7777263578777804e3};oi.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(V,oi);var Ee=function n(t){this._name=t||null,n.nameToTypeMap.put(t,this)},si={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Ee.prototype.readResolve=function(){return Ee.nameToTypeMap.get(this._name)};Ee.prototype.toString=function(){return this._name};Ee.prototype.interfaces_=function(){return[te]};Ee.prototype.getClass=function(){return Ee};si.serialVersionUID.get=function(){return-552860263173159e4};si.nameToTypeMap.get=function(){return new Di};Object.defineProperties(Ee,si);V.Type=Ee;V.FIXED=new Ee("FIXED");V.FLOATING=new Ee("FLOATING");V.FLOATING_SINGLE=new Ee("FLOATING SINGLE");var b=function n(){this._precisionModel=new V,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?P(arguments[0],Yr)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof V&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},bi={serialVersionUID:{configurable:!0}};b.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new p(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new p(t.getMinX(),t.getMinY()),new p(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new p(t.getMinX(),t.getMinY()),new p(t.getMinX(),t.getMaxY()),new p(t.getMaxX(),t.getMaxY()),new p(t.getMaxX(),t.getMinY()),new p(t.getMinX(),t.getMinY())]),null)};b.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new K(this.getCoordinateSequenceFactory().create(t),this);if(P(t,M))return new K(t,this)}else return new K(this.getCoordinateSequenceFactory().create([]),this)};b.prototype.createMultiLineString=function(){if(arguments.length===0)return new mr(null,this);if(arguments.length===1){var t=arguments[0];return new mr(t,this)}};b.prototype.buildGeometry=function(t){for(var e=null,r=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(r=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(b.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof st)return this.createMultiPolygon(b.toPolygonArray(t));if(u instanceof K)return this.createMultiLineString(b.toLineStringArray(t));if(u instanceof Ft)return this.createMultiPoint(b.toPointArray(t));D.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u};b.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};b.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof p){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(P(arguments[0],M)){var e=arguments[0];return new Ft(e,this)}}};b.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};b.prototype.createPolygon=function(){if(arguments.length===0)return new st(null,null,this);if(arguments.length===1){if(P(arguments[0],M)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Me){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new st(i,o,this)}};b.prototype.getSRID=function(){return this._SRID};b.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Lt(null,this);if(arguments.length===1){var t=arguments[0];return new Lt(t,this)}};b.prototype.createGeometry=function(t){var e=new Qt(this);return e.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})};b.prototype.getPrecisionModel=function(){return this._precisionModel};b.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(P(arguments[0],M)){var e=arguments[0];return new Me(e,this)}}};b.prototype.createMultiPolygon=function(){if(arguments.length===0)return new be(null,this);if(arguments.length===1){var t=arguments[0];return new be(t,this)}};b.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Qr(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Qr(e,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(P(arguments[0],M)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());$.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}};b.prototype.interfaces_=function(){return[te]};b.prototype.getClass=function(){return b};b.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)};b.getDefaultCoordinateSequenceFactory=function(){return Ae.instance()};b.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};b.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)};bi.serialVersionUID.get=function(){return-6820524753094096e3};Object.defineProperties(b,bi);var lo=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Yn=function(t){this.geometryFactory=t||new b};Yn.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var r=e.type;if(!ge[r])throw new Error("Unknown GeoJSON type: "+e.type);return lo.indexOf(r)!==-1?ge[r].apply(this,[e.coordinates]):r==="GeometryCollection"?ge[r].apply(this,[e.geometries]):ge[r].apply(this,[e])};Yn.prototype.write=function(t){var e=t.getGeometryType();if(!Ye[e])throw new Error("Geometry is not supported");return Ye[e].apply(this,[t])};var ge={Feature:function(n){var t={};for(var e in n)t[e]=n[e];if(n.geometry){var r=n.geometry.type;if(!ge[r])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=ge.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t=this,e={};if(n.features){e.features=[];for(var r=0;r<n.features.length;++r)e.features.push(t.read(n.features[r]))}return n.bbox&&(e.bbox=this.parse.bbox.apply(this,[n.bbox])),e},coordinates:function(n){for(var t=[],e=0;e<n.length;++e){var r=n[e];t.push(new p(r[0],r[1]))}return t},bbox:function(n){return this.geometryFactory.createLinearRing([new p(n[0],n[1]),new p(n[2],n[1]),new p(n[2],n[3]),new p(n[0],n[3]),new p(n[0],n[1])])},Point:function(n){var t=new p(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(ge.Point.apply(t,[n[r]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(n){var t=ge.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(ge.LineString.apply(t,[n[r]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(n){for(var t=this,e=ge.coordinates.apply(this,[n[0]]),r=this.geometryFactory.createLinearRing(e),i=[],o=1;o<n.length;++o){var s=n[o],a=ge.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(ge.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Ye={coordinate:function(n){return[n.x,n.y]},Point:function(n){var t=Ye.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Ye.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(n){for(var t=this,e=[],r=n.getCoordinates(),i=0;i<r.length;++i){var o=r[i];e.push(Ye.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Ye.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(n){var t=this,e=[],r=Ye.LineString.apply(this,[n._shell]);e.push(r.coordinates);for(var i=0;i<n._holes.length;++i){var o=n._holes[i],s=Ye.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=Ye.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],o=i.getGeometryType();e.push(Ye[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},ai=function(t){this.geometryFactory=t||new b,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Yn(this.geometryFactory)};ai.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===V.FIXED&&this.reducePrecision(e),e};ai.prototype.reducePrecision=function(t){var e=this,r,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(r=0,i=t.points.length;r<i;r++)e.precisionModel.makePrecise(t.points[r]);else if(t.geometries)for(r=0,i=t.geometries.length;r<i;r++)e.reducePrecision(t.geometries[r])};var Ri=function(){this.parser=new Yn(this.geometryFactory)};Ri.prototype.write=function(t){return this.parser.write(t)};var v=function(){},Hn={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};v.prototype.interfaces_=function(){return[]};v.prototype.getClass=function(){return v};v.opposite=function(t){return t===v.LEFT?v.RIGHT:t===v.RIGHT?v.LEFT:t};Hn.ON.get=function(){return 0};Hn.LEFT.get=function(){return 1};Hn.RIGHT.get=function(){return 2};Object.defineProperties(v,Hn);function Wn(n){this.message=n||""}Wn.prototype=new Error;Wn.prototype.name="EmptyStackException";function Oe(){this.array_=[]}Oe.prototype=new ne;Oe.prototype.add=function(n){return this.array_.push(n),!0};Oe.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]};Oe.prototype.push=function(n){return this.array_.push(n),n};Oe.prototype.pop=function(n){if(this.array_.length===0)throw new Wn;return this.array_.pop()};Oe.prototype.peek=function(){if(this.array_.length===0)throw new Wn;return this.array_[this.array_.length-1]};Oe.prototype.empty=function(){return this.array_.length===0};Oe.prototype.isEmpty=function(){return this.empty()};Oe.prototype.search=function(n){return this.array_.indexOf(n)};Oe.prototype.size=function(){return this.array_.length};Oe.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t};var Ce=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ce.prototype.getCoordinate=function(){return this._minCoord};Ce.prototype.getRightmostSide=function(t,e){var r=this.getRightmostSideOfSegment(t,e);return r<0&&(r=this.getRightmostSideOfSegment(t,e-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),r};Ce.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();D.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],r=t[this._minIndex+1],i=I.computeOrientation(this._minCoord,r,e),o=!1;(e.y<this._minCoord.y&&r.y<this._minCoord.y&&i===I.COUNTERCLOCKWISE||e.y>this._minCoord.y&&r.y>this._minCoord.y&&i===I.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)};Ce.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge(),i=r.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=v.LEFT;return i[e].y<i[e+1].y&&(o=v.RIGHT),o};Ce.prototype.getEdge=function(){return this._orientedDe};Ce.prototype.checkForRightmostCoordinate=function(t){for(var e=this,r=t.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(e._minCoord===null||r[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=r[i])};Ce.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};Ce.prototype.findEdge=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();i.isForward()&&e.checkForRightmostCoordinate(i)}D.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var o=this.getRightmostSide(this._minDe,this._minIndex);o===v.LEFT&&(this._orientedDe=this._minDe.getSym())};Ce.prototype.interfaces_=function(){return[]};Ce.prototype.getClass=function(){return Ce};var Je=function(n){function t(e,r){n.call(this,t.msgWithCoord(e,r)),this.pt=r?new p(r):null,this.name="TopologyException"}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},t}(je),jn=function(){this.array_=[]};jn.prototype.addLast=function(t){this.array_.push(t)};jn.prototype.removeFirst=function(){return this.array_.shift()};jn.prototype.isEmpty=function(){return this.array_.length===0};var Pt=function(){this._finder=null,this._dirEdgeList=new y,this._nodes=new y,this._rightMostCoord=null,this._env=null,this._finder=new Ce};Pt.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}};Pt.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Pt.prototype.computeNodeDepth=function(t){for(var e=this,r=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){r=o;break}}if(r===null)throw new Je("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(r);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}};Pt.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(v.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)};Pt.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Pt.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(v.RIGHT)>=1&&e.getDepth(v.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}};Pt.prototype.computeDepths=function(t){var e=this,r=new ri,i=new jn,o=t.getNode();for(i.addLast(o),r.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();r.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();r.contains(c)||(i.addLast(c),r.add(c))}}}};Pt.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0};Pt.prototype.getEnvelope=function(){if(this._env===null){for(var t=new N,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next(),i=r.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env};Pt.prototype.addReachable=function(t){var e=this,r=new Oe;for(r.add(t);!r.empty();){var i=r.pop();e.add(i,r)}};Pt.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(v.LEFT,t.getDepth(v.RIGHT)),e.setDepth(v.RIGHT,t.getDepth(v.LEFT))};Pt.prototype.add=function(t,e){var r=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();r._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}};Pt.prototype.getNodes=function(){return this._nodes};Pt.prototype.getDirectedEdges=function(){return this._dirEdgeList};Pt.prototype.interfaces_=function(){return[$t]};Pt.prototype.getClass=function(){return Pt};var X=function n(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[v.ON]=r}else if(arguments[0]instanceof n){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[v.ON]=s,this.location[v.LEFT]=a,this.location[v.RIGHT]=u}};X.prototype.setAllLocations=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]=t};X.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==h.NONE)return!1;return!0};X.prototype.setAllLocationsIfNull=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]===h.NONE&&(e.location[r]=t)};X.prototype.isLine=function(){return this.location.length===1};X.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var r=new Array(3).fill(null);r[v.ON]=this.location[v.ON],r[v.LEFT]=h.NONE,r[v.RIGHT]=h.NONE,this.location=r}for(var i=0;i<this.location.length;i++)e.location[i]===h.NONE&&i<t.location.length&&(e.location[i]=t.location[i])};X.prototype.getLocations=function(){return this.location};X.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[v.LEFT];this.location[v.LEFT]=this.location[v.RIGHT],this.location[v.RIGHT]=t};X.prototype.toString=function(){var t=new we;return this.location.length>1&&t.append(h.toLocationSymbol(this.location[v.LEFT])),t.append(h.toLocationSymbol(this.location[v.ON])),this.location.length>1&&t.append(h.toLocationSymbol(this.location[v.RIGHT])),t.toString()};X.prototype.setLocations=function(t,e,r){this.location[v.ON]=t,this.location[v.LEFT]=e,this.location[v.RIGHT]=r};X.prototype.get=function(t){return t<this.location.length?this.location[t]:h.NONE};X.prototype.isArea=function(){return this.location.length>1};X.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===h.NONE)return!0;return!1};X.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(v.ON,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.location[e]=r}};X.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(h.NONE)};X.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]};X.prototype.allPositionsEqual=function(t){for(var e=this,r=0;r<this.location.length;r++)if(e.location[r]!==t)return!1;return!0};X.prototype.interfaces_=function(){return[]};X.prototype.getClass=function(){return X};var U=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new X(t),this.elt[1]=new X(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.elt[0]=new X(e.elt[0]),this.elt[1]=new X(e.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new X(h.NONE),this.elt[1]=new X(h.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new X(o,s,a),this.elt[1]=new X(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new X(h.NONE,h.NONE,h.NONE),this.elt[1]=new X(h.NONE,h.NONE,h.NONE),this.elt[u].setLocations(l,c,f)}};U.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t};U.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)};U.prototype.isNull=function(t){return this.elt[t].isNull()};U.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.elt[e].setAllLocationsIfNull(r)}};U.prototype.isLine=function(t){return this.elt[t].isLine()};U.prototype.merge=function(t){for(var e=this,r=0;r<2;r++)e.elt[r]===null&&t.elt[r]!==null?e.elt[r]=new X(t.elt[r]):e.elt[r].merge(t.elt[r])};U.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()};U.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(v.ON)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.elt[e].get(r)}};U.prototype.toString=function(){var t=new we;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()};U.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}};U.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()};U.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(v.ON,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this.elt[r].setLocation(i,o)}};U.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)};U.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)};U.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new X(this.elt[t].location[0]))};U.prototype.interfaces_=function(){return[]};U.prototype.getClass=function(){return U};U.toLineLabel=function(t){for(var e=new U(h.NONE),r=0;r<2;r++)e.setLocation(r,t.getLocation(r));return e};var nt=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new y,this._pts=new y,this._label=new U(h.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new y,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};nt.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)e[r]=t._pts.get(r);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=I.isCCW(this._ring.getCoordinates())};nt.prototype.isIsolated=function(){return this._label.getGeometryCount()===1};nt.prototype.computePoints=function(t){var e=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Je("Found null DirectedEdge");if(r.getEdgeRing()===e)throw new Je("Directed Edge visited twice during ring-building at "+r.getCoordinate());e._edges.add(r);var o=r.getLabel();D.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(r.getEdge(),r.isForward(),i),i=!1,e.setEdgeRing(r,e),r=e.getNext(r)}while(r!==this._startDe)};nt.prototype.getLinearRing=function(){return this._ring};nt.prototype.getCoordinate=function(t){return this._pts.get(t)};nt.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var r=e.getNode(),i=r.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2};nt.prototype.addPoints=function(t,e,r){var i=this,o=t.getCoordinates();if(e){var s=1;r&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;r&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}};nt.prototype.isHole=function(){return this._isHole};nt.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};nt.prototype.containsPoint=function(t){var e=this.getLinearRing(),r=e.getEnvelopeInternal();if(!r.contains(t)||!I.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0};nt.prototype.addHole=function(t){this._holes.add(t)};nt.prototype.isShell=function(){return this._shell===null};nt.prototype.getLabel=function(){return this._label};nt.prototype.getEdges=function(){return this._edges};nt.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};nt.prototype.getShell=function(){return this._shell};nt.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=e.getLocation(r,v.RIGHT);if(i===h.NONE)return null;if(this._label.getLocation(r)===h.NONE)return this._label.setLocation(r,i),null}};nt.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};nt.prototype.toPolygon=function(t){for(var e=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),r);return o};nt.prototype.interfaces_=function(){return[]};nt.prototype.getClass=function(){return nt};var co=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},t.prototype.getNext=function(r){return r.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(nt),fo=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var r=this,i=new y,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new co(o,r._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(r){return r.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(nt),kt=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};kt.prototype.setVisited=function(t){this._isVisited=t};kt.prototype.setInResult=function(t){this._isInResult=t};kt.prototype.isCovered=function(){return this._isCovered};kt.prototype.isCoveredSet=function(){return this._isCoveredSet};kt.prototype.setLabel=function(t){this._label=t};kt.prototype.getLabel=function(){return this._label};kt.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0};kt.prototype.updateIM=function(t){D.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)};kt.prototype.isInResult=function(){return this._isInResult};kt.prototype.isVisited=function(){return this._isVisited};kt.prototype.interfaces_=function(){return[]};kt.prototype.getClass=function(){return kt};var Kn=function(n){function t(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new U(0,h.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(r){},t.prototype.computeMergedLocation=function(r,i){var o=h.NONE;if(o=this._label.getLocation(i),!r.isNull(i)){var s=r.getLocation(i);o!==h.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new U(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof U)for(var o=arguments[0],s=0;s<2;s++){var a=r.computeMergedLocation(o,s),u=r._label.getLocation(s);u===h.NONE&&r._label.setLocation(s,a)}},t.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},t.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=h.NONE;this._label!==null&&(i=this._label.getLocation(r));var o=null;switch(i){case h.BOUNDARY:o=h.INTERIOR;break;case h.INTERIOR:o=h.BOUNDARY;break;default:o=h.BOUNDARY;break}this._label.setLocation(r,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(kt),Ne=function(){this.nodeMap=new _t,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ne.prototype.find=function(t){return this.nodeMap.get(t)};Ne.prototype.addNode=function(){if(arguments[0]instanceof p){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Kn){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}};Ne.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}};Ne.prototype.iterator=function(){return this.nodeMap.values().iterator()};Ne.prototype.values=function(){return this.nodeMap.values()};Ne.prototype.getBoundaryNodes=function(t){for(var e=new y,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(t)===h.BOUNDARY&&e.add(i)}return e};Ne.prototype.add=function(t){var e=t.getCoordinate(),r=this.addNode(e);r.add(t)};Ne.prototype.interfaces_=function(){return[]};Ne.prototype.getClass=function(){return Ne};var q=function(){},Rn={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};q.prototype.interfaces_=function(){return[]};q.prototype.getClass=function(){return q};q.isNorthern=function(t){return t===q.NE||t===q.NW};q.isOpposite=function(t,e){if(t===e)return!1;var r=(t-e+4)%4;return r===2};q.commonHalfPlane=function(t,e){if(t===e)return t;var r=(t-e+4)%4;if(r===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i};q.isInHalfPlane=function(t,e){return e===q.SE?t===q.SE||t===q.SW:t===e||t===e+1};q.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new H("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?q.NE:q.SE:e>=0?q.NW:q.SW}else if(arguments[0]instanceof p&&arguments[1]instanceof p){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new H("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?q.NE:q.SE:i.y>=r.y?q.NW:q.SW}};Rn.NE.get=function(){return 0};Rn.NW.get=function(){return 1};Rn.SW.get=function(){return 2};Rn.SE.get=function(){return 3};Object.defineProperties(q,Rn);var yt=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(r,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};yt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:I.computeOrientation(t._p0,t._p1,this._p1)};yt.prototype.getDy=function(){return this._dy};yt.prototype.getCoordinate=function(){return this._p0};yt.prototype.setNode=function(t){this._node=t};yt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),o=r.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)};yt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)};yt.prototype.getDirectedCoordinate=function(){return this._p1};yt.prototype.getDx=function(){return this._dx};yt.prototype.getLabel=function(){return this._label};yt.prototype.getEdge=function(){return this._edge};yt.prototype.getQuadrant=function(){return this._quadrant};yt.prototype.getNode=function(){return this._node};yt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),r=e.lastIndexOf("."),i=e.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label};yt.prototype.computeLabel=function(t){};yt.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=q.quadrant(this._dx,this._dy),D.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")};yt.prototype.interfaces_=function(){return[$t]};yt.prototype.getClass=function(){return yt};var $n=function(n){function t(){var e=arguments[0],r=arguments[1];if(n.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=r,r)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(r){return this._depth[r]},t.prototype.setVisited=function(r){this._isVisited=r},t.prototype.computeDirectedLabel=function(){this._label=new U(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new Je("assigned depths do not match",this.getCoordinate());this._depth[r]=i},t.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,o=0;o<2;o++)r._label.isArea(o)&&r._label.getLocation(o,v.LEFT)===h.INTERIOR&&r._label.getLocation(o,v.RIGHT)===h.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(r){this._nextMin=r},t.prototype.print=function(r){n.prototype.print.call(this,r),r.print(" "+this._depth[v.LEFT]+"/"+this._depth[v.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},t.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},t.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,h.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,h.EXTERIOR);return r&&i&&o},t.prototype.setEdgeRing=function(r){this._edgeRing=r},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},t.prototype.setInResult=function(r){this._isInResult=r},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},t.prototype.setSym=function(r){this._sym=r},t.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},t.prototype.setEdgeDepths=function(r,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;r===v.LEFT&&(s=-1);var a=v.opposite(r),u=o*s,l=i+u;this.setDepth(r,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(r){this._next=r},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(r,i){return r===h.EXTERIOR&&i===h.INTERIOR?1:r===h.INTERIOR&&i===h.EXTERIOR?-1:0},t}(yt),Zr=function(){};Zr.prototype.createNode=function(t){return new Kn(t,null)};Zr.prototype.interfaces_=function(){return[]};Zr.prototype.getClass=function(){return Zr};var j=function(){if(this._edges=new y,this._nodes=null,this._edgeEndList=new y,arguments.length===0)this._nodes=new Ne(new Zr);else if(arguments.length===1){var t=arguments[0];this._nodes=new Ne(t)}};j.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var r=0;r<this._edges.size();r++){t.println("edge "+r+":");var i=e._edges.get(r);i.print(t),i.eiList.print(t)}};j.prototype.find=function(t){return this._nodes.find(t)};j.prototype.addNode=function(){if(arguments[0]instanceof Kn){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof p){var e=arguments[0];return this._nodes.addNode(e)}};j.prototype.getNodeIterator=function(){return this._nodes.iterator()};j.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}};j.prototype.debugPrintln=function(t){ht.out.println(t)};j.prototype.isBoundaryNode=function(t,e){var r=this._nodes.find(e);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===h.BOUNDARY};j.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}};j.prototype.matchInSameDirection=function(t,e,r,i){return t.equals(r)?I.computeOrientation(t,e,i)===I.COLLINEAR&&q.quadrant(t,e)===q.quadrant(r,i):!1};j.prototype.getEdgeEnds=function(){return this._edgeEndList};j.prototype.debugPrint=function(t){ht.out.print(t)};j.prototype.getEdgeIterator=function(){return this._edges.iterator()};j.prototype.findEdgeInSameDirection=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var o=r._edges.get(i),s=o.getCoordinates();if(r.matchInSameDirection(t,e,s[0],s[1])||r.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null};j.prototype.insertEdge=function(t){this._edges.add(t)};j.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var r=e.next();if(r.getEdge()===t)return r}return null};j.prototype.addEdges=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();e._edges.add(i);var o=new $n(i,!0),s=new $n(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}};j.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)};j.prototype.getNodes=function(){return this._nodes.values()};j.prototype.findEdge=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var o=r._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null};j.prototype.interfaces_=function(){return[]};j.prototype.getClass=function(){return j};j.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.getEdges().linkResultDirectedEdges()}};var Bt=function(){this._geometryFactory=null,this._shellList=new y;var t=arguments[0];this._geometryFactory=t};Bt.prototype.sortShellsAndHoles=function(t,e,r){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?r.add(o):e.add(o)}};Bt.prototype.computePolygons=function(t){for(var e=this,r=new y,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);r.add(s)}return r};Bt.prototype.placeFreeHoles=function(t,e){for(var r=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=r.findEdgeRingContaining(o,t);if(s===null)throw new Je("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}};Bt.prototype.buildMinimalEdgeRings=function(t,e,r){for(var i=this,o=new y,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):r.addAll(u)}else o.add(a)}return o};Bt.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var r=e.next();if(r.containsPoint(t))return!0}return!1};Bt.prototype.buildMaximalEdgeRings=function(t){for(var e=this,r=new y,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new fo(o,e._geometryFactory);r.add(s),s.setInResult()}}return r};Bt.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}};Bt.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};Bt.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),i=r.getEnvelopeInternal(),o=r.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var g=!1;f.contains(i)&&I.isPointInRing(o,c.getCoordinates())&&(g=!0),g&&(s===null||a.contains(f))&&(s=l)}return s};Bt.prototype.findShell=function(t){for(var e=0,r=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(r=o,e++)}return D.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r};Bt.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],r=arguments[1];j.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(e),o=new y,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}};Bt.prototype.interfaces_=function(){return[]};Bt.prototype.getClass=function(){return Bt};var $r=function(){};$r.prototype.getBounds=function(){};$r.prototype.interfaces_=function(){return[]};$r.prototype.getClass=function(){return $r};var se=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};se.prototype.getItem=function(){return this._item};se.prototype.getBounds=function(){return this._bounds};se.prototype.interfaces_=function(){return[$r,te]};se.prototype.getClass=function(){return se};var Qe=function(){this._size=null,this._items=null,this._size=0,this._items=new y,this._items.add(null)};Qe.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};Qe.prototype.size=function(){return this._size};Qe.prototype.reorder=function(t){for(var e=this,r=null,i=this._items.get(t);t*2<=this._size&&(r=t*2,r!==e._size&&e._items.get(r+1).compareTo(e._items.get(r))<0&&r++,e._items.get(r).compareTo(i)<0);t=r)e._items.set(t,e._items.get(r));this._items.set(t,i)};Qe.prototype.clear=function(){this._size=0,this._items.clear()};Qe.prototype.isEmpty=function(){return this._size===0};Qe.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)e._items.set(r,e._items.get(Math.trunc(r/2)));this._items.set(r,t)};Qe.prototype.interfaces_=function(){return[]};Qe.prototype.getClass=function(){return Qe};var or=function(){};or.prototype.visitItem=function(t){};or.prototype.interfaces_=function(){return[]};or.prototype.getClass=function(){return or};var wr=function(){};wr.prototype.insert=function(t,e){};wr.prototype.remove=function(t,e){};wr.prototype.query=function(){};wr.prototype.interfaces_=function(){return[]};wr.prototype.getClass=function(){return wr};var ot=function(){if(this._childBoundables=new y,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Ti={serialVersionUID:{configurable:!0}};ot.prototype.getLevel=function(){return this._level};ot.prototype.size=function(){return this._childBoundables.size()};ot.prototype.getChildBoundables=function(){return this._childBoundables};ot.prototype.addChildBoundable=function(t){D.isTrue(this._bounds===null),this._childBoundables.add(t)};ot.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};ot.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};ot.prototype.interfaces_=function(){return[$r,te]};ot.prototype.getClass=function(){return ot};Ti.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(ot,Ti);var ae=function(){};ae.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}};ae.min=function(t){return ae.sort(t),t.get(0)};ae.sort=function(t,e){var r=t.toArray();e?gr.sort(r,e):gr.sort(r);for(var i=t.iterator(),o=0,s=r.length;o<s;o++)i.next(),i.set(r[o])};ae.singletonList=function(t){var e=new y;return e.add(t),e};var et=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=r,this._distance=this.distance()};et.prototype.expandToQueue=function(t,e){var r=et.isComposite(this._boundable1),i=et.isComposite(this._boundable2);if(r&&i)return et.area(this._boundable1)>et.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new H("neither boundable is composite")};et.prototype.isLeaves=function(){return!(et.isComposite(this._boundable1)||et.isComposite(this._boundable2))};et.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0};et.prototype.expand=function(t,e,r,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new et(u,e,o._itemDistance);l.getDistance()<i&&r.add(l)}};et.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2};et.prototype.getDistance=function(){return this._distance};et.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())};et.prototype.interfaces_=function(){return[$t]};et.prototype.getClass=function(){return et};et.area=function(t){return t.getBounds().getArea()};et.isComposite=function(t){return t instanceof ot};var at=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new y,this._nodeCapacity=null,arguments.length===0){var t=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];D.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Jn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};at.prototype.getNodeCapacity=function(){return this._nodeCapacity};at.prototype.lastNode=function(t){return t.get(t.size()-1)};at.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof ot?r+=t.size(o):o instanceof se&&(r+=1)}return r}};at.prototype.removeItem=function(t,e){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof se&&o.getItem()===e&&(r=o)}return r!==null?(t.getChildBoundables().remove(r),!0):!1};at.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new y:e}else if(arguments.length===1){for(var r=arguments[0],i=new y,o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof ot){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof se?i.add(s.getItem()):D.shouldNeverReachHere()}return i.size()<=0?null:i}};at.prototype.insert=function(t,e){D.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new se(t,e))};at.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],r=new y;return this.boundablesAtLevel(e,this._root,r),r}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(D.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof ot?t.boundablesAtLevel(i,u,s):(D.isTrue(u instanceof se),i===-1&&s.add(u))}return null}};at.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var r=new y;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,r),r}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(P(arguments[2],or)&&arguments[0]instanceof Object&&arguments[1]instanceof ot)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof ot?t.query(s,f,u):f instanceof se?u.visitItem(f.getItem()):D.shouldNeverReachHere())}else if(P(arguments[2],ne)&&arguments[0]instanceof Object&&arguments[1]instanceof ot)for(var g=arguments[0],m=arguments[1],_=arguments[2],E=m.getChildBoundables(),C=0;C<E.size();C++){var S=E.get(C);t.getIntersectsOp().intersects(S.getBounds(),g)&&(S instanceof ot?t.query(g,S,_):S instanceof se?_.add(S.getItem()):D.shouldNeverReachHere())}}};at.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};at.prototype.getRoot=function(){return this.build(),this._root};at.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof ot&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}};at.prototype.createHigherLevels=function(t,e){D.isTrue(!t.isEmpty());var r=this.createParentBoundables(t,e+1);return r.size()===1?r.get(0):this.createHigherLevels(r,e+1)};at.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof ot){var s=t.depth(o);s>r&&(r=s)}}return r+1}};at.prototype.createParentBoundables=function(t,e){var r=this;D.isTrue(!t.isEmpty());var i=new y;i.add(this.createNode(e));var o=new y(t);ae.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(e)),r.lastNode(i).addChildBoundable(a)}return i};at.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};at.prototype.interfaces_=function(){return[te]};at.prototype.getClass=function(){return at};at.compareDoubles=function(t,e){return t>e?1:t<e?-1:0};Jn.IntersectsOp.get=function(){return po};Jn.serialVersionUID.get=function(){return-3886435814360241e3};Jn.DEFAULT_NODE_CAPACITY.get=function(){return 10};Object.defineProperties(at,Jn);var po=function(){},tn=function(){};tn.prototype.distance=function(t,e){};tn.prototype.interfaces_=function(){return[]};tn.prototype.getClass=function(){return tn};var Mi=function(n){function t(r){r=r||t.DEFAULT_NODE_CAPACITY,n.call(this,r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;D.isTrue(i.length>0);for(var a=new y,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new Ei(i)},t.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;n.prototype.insert.call(this,i,o)}else return n.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new y;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return n.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];n.prototype.query.call(this,o,s)}else if(arguments.length===3){if(P(arguments[2],or)&&arguments[0]instanceof Object&&arguments[1]instanceof ot){var a=arguments[0],u=arguments[1],l=arguments[2];n.prototype.query.call(this,a,u,l)}else if(P(arguments[2],ne)&&arguments[0]instanceof Object&&arguments[1]instanceof ot){var c=arguments[0],f=arguments[1],g=arguments[2];n.prototype.query.call(this,c,f,g)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return n.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return n.prototype.remove.call(this,i,o)}else return n.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){D.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new y(i);ae.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(P(arguments[0],tn)){var i=arguments[0],o=new et(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof et){var s=arguments[0];return this.nearestNeighbour(s,w.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&P(arguments[1],tn)){var a=arguments[0],u=arguments[1],l=new et(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof et&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],g=f,m=null,_=new Qe;for(_.add(c);!_.isEmpty()&&g>0;){var E=_.poll(),C=E.getDistance();if(C>=g)break;E.isLeaves()?(g=C,m=E):E.expandToQueue(_,g)}return[m.getBoundable(0).getItem(),m.getBoundable(1).getItem()]}}else if(arguments.length===3){var S=arguments[0],A=arguments[1],F=arguments[2],Et=new se(S,A),ee=new et(this.getRoot(),Et,F);return this.nearestNeighbour(ee)[0]}},t.prototype.interfaces_=function(){return[wr,te]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return Ei},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Xr]},compare:function(r,i){return n.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Xr]},compare:function(r,i){return n.compareDoubles(t.centreY(r.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(at),Ei=function(n){function t(){var e=arguments[0];n.call(this,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();r===null?r=new N(o.getBounds()):r.expandToInclude(o.getBounds())}return r},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ot),Dt=function(){};Dt.prototype.interfaces_=function(){return[]};Dt.prototype.getClass=function(){return Dt};Dt.relativeSign=function(t,e){return t<e?-1:t>e?1:0};Dt.compare=function(t,e,r){if(e.equals2D(r))return 0;var i=Dt.relativeSign(e.x,r.x),o=Dt.relativeSign(e.y,r.y);switch(t){case 0:return Dt.compareValue(i,o);case 1:return Dt.compareValue(o,i);case 2:return Dt.compareValue(o,-i);case 3:return Dt.compareValue(-i,o);case 4:return Dt.compareValue(-i,-o);case 5:return Dt.compareValue(-o,-i);case 6:return Dt.compareValue(-o,i);case 7:return Dt.compareValue(i,-o)}return D.shouldNeverReachHere("invalid octant value"),0};Dt.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var sr=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._segString=t,this.coord=new p(e),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(r))};sr.prototype.getCoordinate=function(){return this.coord};sr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)};sr.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Dt.compare(this._segmentOctant,this.coord,e.coord)};sr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t};sr.prototype.isInterior=function(){return this._isInterior};sr.prototype.interfaces_=function(){return[$t]};sr.prototype.getClass=function(){return sr};var wt=function(){this._nodeMap=new _t,this._edge=null;var t=arguments[0];this._edge=t};wt.prototype.getSplitCoordinates=function(){var t=this,e=new Dn;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()};wt.prototype.addCollapsedNodes=function(){var t=this,e=new y;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var r=e.iterator();r.hasNext();){var i=r.next().intValue();t.add(t._edge.getCoordinate(i),i)}};wt.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}};wt.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,r=0;r<this._edge.size()-2;r++){var i=e._edge.getCoordinate(r),o=e._edge.getCoordinate(r+2);i.equals2D(o)&&t.add(new _e(r+1))}};wt.prototype.addEdgeCoordinates=function(t,e,r){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);r.add(new p(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)r.add(i._edge.getCoordinate(a));s&&r.add(new p(e.coord))};wt.prototype.iterator=function(){return this._nodeMap.values().iterator()};wt.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}};wt.prototype.findCollapseIndex=function(t,e,r){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(r[0]=t.segmentIndex+1,!0):!1};wt.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,r=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,r);a&&t.add(new _e(r[0])),o=s}};wt.prototype.getEdge=function(){return this._edge};wt.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)};wt.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new p(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r._edge.getCoordinate(l);return s&&(a[u]=new p(e.coord)),new tt(a,this._edge.getData())};wt.prototype.add=function(t,e){var r=new sr(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(r);return i!==null?(D.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)};wt.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(e[0]))throw new je("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new je("bad split edge end point at "+a)};wt.prototype.interfaces_=function(){return[]};wt.prototype.getClass=function(){return wt};var Or=function(){};Or.prototype.interfaces_=function(){return[]};Or.prototype.getClass=function(){return Or};Or.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new H("Cannot compute the octant for point ( "+t+", "+e+" )");var r=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?r>=i?0:1:r>=i?7:6:e>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof p&&arguments[1]instanceof p){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new H("Cannot compute the octant for two identical points "+o);return Or.octant(a,u)}};var Fe=function(){};Fe.prototype.getCoordinates=function(){};Fe.prototype.size=function(){};Fe.prototype.getCoordinate=function(t){};Fe.prototype.isClosed=function(){};Fe.prototype.setData=function(t){};Fe.prototype.getData=function(){};Fe.prototype.interfaces_=function(){return[]};Fe.prototype.getClass=function(){return Fe};var En=function(){};En.prototype.addIntersection=function(t,e){};En.prototype.interfaces_=function(){return[Fe]};En.prototype.getClass=function(){return En};var tt=function(){this._nodeList=new wt(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};tt.prototype.getCoordinates=function(){return this._pts};tt.prototype.size=function(){return this._pts.length};tt.prototype.getCoordinate=function(t){return this._pts[t]};tt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};tt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};tt.prototype.setData=function(t){this._data=t};tt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Or.octant(t,e)};tt.prototype.getData=function(){return this._data};tt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[3],s=new p(r.getIntersection(o));this.addIntersection(s,i)}};tt.prototype.toString=function(){return ie.toLineString(new Q(this._pts))};tt.prototype.getNodeList=function(){return this._nodeList};tt.prototype.addIntersectionNode=function(t,e){var r=e,i=r+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(r=i)}var s=this._nodeList.add(t,r);return s};tt.prototype.addIntersections=function(t,e,r){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,r,o)};tt.prototype.interfaces_=function(){return[En]};tt.prototype.getClass=function(){return tt};tt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new y;return tt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],o=r.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var x=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new p,this.p1=new p;else if(arguments.length===1){var t=arguments[0];this.p0=new p(t.p0),this.p1=new p(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this.p0=new p(e,r),this.p1=new p(i,o)}},Ai={serialVersionUID:{configurable:!0}};x.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)};x.prototype.orientationIndex=function(){if(arguments[0]instanceof x){var t=arguments[0],e=I.orientationIndex(this.p0,this.p1,t.p0),r=I.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}else if(arguments[0]instanceof p){var i=arguments[0];return I.orientationIndex(this.p0,this.p1,i)}};x.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};x.prototype.isVertical=function(){return this.p0.x===this.p1.x};x.prototype.equals=function(t){if(!(t instanceof x))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)};x.prototype.intersection=function(t){var e=new Sr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null};x.prototype.project=function(){if(arguments[0]instanceof p){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new p(t);var e=this.projectionFactor(t),r=new p;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof x){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new x(a,u)}};x.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};x.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};x.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};x.prototype.distancePerpendicular=function(t){return I.distancePointLinePerpendicular(t,this.p0,this.p1)};x.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};x.prototype.midPoint=function(){return x.midPoint(this.p0,this.p1)};x.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,r=this.p1.y-this.p0.y,i=e*e+r*r;if(i<=0)return w.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/i;return o};x.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var r=new Array(2).fill(null),i=w.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),r[0]=s,r[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,r[0]=a,r[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,r[0]=this.p0,r[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,r[0]=this.p1,r[1]=l),r};x.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var r=this.p0.distance(t),i=this.p1.distance(t);return r<i?this.p0:this.p1};x.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)};x.prototype.getLength=function(){return this.p0.distance(this.p1)};x.prototype.compareTo=function(t){var e=t,r=this.p0.compareTo(e.p0);return r!==0?r:this.p1.compareTo(e.p1)};x.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t};x.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)};x.prototype.lineIntersection=function(t){try{var e=re.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(r){if(!(r instanceof ln))throw r}finally{}return null};x.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)};x.prototype.pointAlongOffset=function(t,e){var r=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=r-l,f=i+u,g=new p(c,f);return g};x.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=r.x,this.p1.y=r.y}};x.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||w.isNaN(e))&&(e=1),e};x.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};x.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};x.prototype.distance=function(){if(arguments[0]instanceof x){var t=arguments[0];return I.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof p){var e=arguments[0];return I.distancePointLine(e,this.p0,this.p1)}};x.prototype.pointAlong=function(t){var e=new p;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};x.prototype.hashCode=function(){var t=w.doubleToLongBits(this.p0.x);t^=w.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),r=w.doubleToLongBits(this.p1.x);r^=w.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return e^i};x.prototype.interfaces_=function(){return[$t,te]};x.prototype.getClass=function(){return x};x.midPoint=function(t,e){return new p((t.x+e.x)/2,(t.y+e.y)/2)};Ai.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(x,Ai);var Cn=function(){this.tempEnv1=new N,this.tempEnv2=new N,this._overlapSeg1=new x,this._overlapSeg2=new x};Cn.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}};Cn.prototype.interfaces_=function(){return[]};Cn.prototype.getClass=function(){return Cn};var Gt=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],r=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=i};Gt.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]};Gt.prototype.computeSelect=function(t,e,r,i){var o=this._pts[e],s=this._pts[r];if(i.tempEnv1.init(o,s),r-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+r)/2);e<a&&this.computeSelect(t,e,a,i),a<r&&this.computeSelect(t,a,r,i)};Gt.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)e[r++]=t._pts[i];return e};Gt.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)};Gt.prototype.setId=function(t){this._id=t};Gt.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)};Gt.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new N(t,e)}return this._env};Gt.prototype.getEndIndex=function(){return this._end};Gt.prototype.getStartIndex=function(){return this._start};Gt.prototype.getContext=function(){return this._context};Gt.prototype.getId=function(){return this._id};Gt.prototype.computeOverlapsInternal=function(t,e,r,i,o,s){var a=this._pts[t],u=this._pts[e],l=r._pts[i],c=r._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,r,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),g=Math.trunc((i+o)/2);t<f&&(i<g&&this.computeOverlapsInternal(t,f,r,i,g,s),g<o&&this.computeOverlapsInternal(t,f,r,g,o,s)),f<e&&(i<g&&this.computeOverlapsInternal(f,e,r,i,g,s),g<o&&this.computeOverlapsInternal(f,e,r,g,o,s))};Gt.prototype.interfaces_=function(){return[]};Gt.prototype.getClass=function(){return Gt};var ve=function(){};ve.prototype.interfaces_=function(){return[]};ve.prototype.getClass=function(){return ve};ve.getChainStartIndices=function(t){var e=0,r=new y;r.add(new _e(e));do{var i=ve.findChainEnd(t,e);r.add(new _e(i)),e=i}while(e<t.length-1);var o=ve.toIntArray(r);return o};ve.findChainEnd=function(t,e){for(var r=e;r<t.length-1&&t[r].equals2D(t[r+1]);)r++;if(r>=t.length-1)return t.length-1;for(var i=q.quadrant(t[r],t[r+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=q.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1};ve.getChains=function(){if(arguments.length===1){var t=arguments[0];return ve.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],r=arguments[1],i=new y,o=ve.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new Gt(e,o[s],o[s+1],r);i.add(a)}return i}};ve.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var vr=function(){};vr.prototype.computeNodes=function(t){};vr.prototype.getNodedSubstrings=function(){};vr.prototype.interfaces_=function(){return[]};vr.prototype.getClass=function(){return vr};var Nn=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Nn.prototype.setSegmentIntersector=function(t){this._segInt=t};Nn.prototype.interfaces_=function(){return[vr]};Nn.prototype.getClass=function(){return Nn};var ui=function(n){function t(r){r?n.call(this,r):n.call(this),this._monoChains=new y,this._index=new Mi,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return tt.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=ve.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new Ci(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Ci},Object.defineProperties(t,e),t}(Nn),Ci=function(n){function t(){n.call(this),this._si=null;var e=arguments[0];this._si=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=r.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return n.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cn),G=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},tr={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}};G.prototype.getEndCapStyle=function(){return this._endCapStyle};G.prototype.isSingleSided=function(){return this._isSingleSided};G.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=G.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=G.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==G.JOIN_ROUND&&(this._quadrantSegments=G.DEFAULT_QUADRANT_SEGMENTS)};G.prototype.getJoinStyle=function(){return this._joinStyle};G.prototype.setJoinStyle=function(t){this._joinStyle=t};G.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};G.prototype.getSimplifyFactor=function(){return this._simplifyFactor};G.prototype.getQuadrantSegments=function(){return this._quadrantSegments};G.prototype.setEndCapStyle=function(t){this._endCapStyle=t};G.prototype.getMitreLimit=function(){return this._mitreLimit};G.prototype.setMitreLimit=function(t){this._mitreLimit=t};G.prototype.setSingleSided=function(t){this._isSingleSided=t};G.prototype.interfaces_=function(){return[]};G.prototype.getClass=function(){return G};G.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)};tr.CAP_ROUND.get=function(){return 1};tr.CAP_FLAT.get=function(){return 2};tr.CAP_SQUARE.get=function(){return 3};tr.JOIN_ROUND.get=function(){return 1};tr.JOIN_MITRE.get=function(){return 2};tr.JOIN_BEVEL.get=function(){return 3};tr.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};tr.DEFAULT_MITRE_LIMIT.get=function(){return 5};tr.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(G,tr);var J=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=I.COUNTERCLOCKWISE,this._inputLine=t||null},Tn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};J.prototype.isDeletable=function(t,e,r,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[r];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,r,i)};J.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,r,i,t._distanceTol)&&(t._isDeleted[r]=J.DELETE,s=!0,o=!0),s?e=i:e=r,r=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(r)}return o};J.prototype.isShallowConcavity=function(t,e,r,i){var o=I.computeOrientation(t,e,r),s=o===this._angleOrientation;if(!s)return!1;var a=I.distancePointLine(e,t,r);return a<i};J.prototype.isShallowSampled=function(t,e,r,i,o){var s=this,a=Math.trunc((i-r)/J.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=r;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0};J.prototype.isConcave=function(t,e,r){var i=I.computeOrientation(t,e,r),o=i===this._angleOrientation;return o};J.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=I.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=e.deleteShallowConcavities();while(r);return this.collapseLine()};J.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===J.DELETE;)e++;return e};J.prototype.isShallow=function(t,e,r,i){var o=I.distancePointLine(e,t,r);return o<i};J.prototype.collapseLine=function(){for(var t=this,e=new Dn,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==J.DELETE&&e.add(t._inputLine[r]);return e.toCoordinateArray()};J.prototype.interfaces_=function(){return[]};J.prototype.getClass=function(){return J};J.simplify=function(t,e){var r=new J(t);return r.simplify(e)};Tn.INIT.get=function(){return 0};Tn.DELETE.get=function(){return 1};Tn.KEEP.get=function(){return 1};Tn.NUM_PTS_TO_CHECK.get=function(){return 10};Object.defineProperties(J,Tn);var Xt=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new y},Fi={COORDINATE_ARRAY_TYPE:{configurable:!0}};Xt.prototype.getCoordinates=function(){var t=this._ptList.toArray(Xt.COORDINATE_ARRAY_TYPE);return t};Xt.prototype.setPrecisionModel=function(t){this._precisionModel=t};Xt.prototype.addPt=function(t){var e=new p(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)};Xt.prototype.revere=function(){};Xt.prototype.addPts=function(t,e){var r=this;if(e)for(var i=0;i<t.length;i++)r.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)r.addPt(t[o])};Xt.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),r=t.distance(e);return r<this._minimimVertexDistance};Xt.prototype.toString=function(){var t=new b,e=t.createLineString(this.getCoordinates());return e.toString()};Xt.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new p(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)};Xt.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t};Xt.prototype.interfaces_=function(){return[]};Xt.prototype.getClass=function(){return Xt};Fi.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)};Object.defineProperties(Xt,Fi);var T=function(){},qr={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};T.prototype.interfaces_=function(){return[]};T.prototype.getClass=function(){return T};T.toDegrees=function(t){return t*180/Math.PI};T.normalize=function(t){for(;t>Math.PI;)t-=T.PI_TIMES_2;for(;t<=-Math.PI;)t+=T.PI_TIMES_2;return t};T.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=r.x-e.x,o=r.y-e.y;return Math.atan2(o,i)}};T.isAcute=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*s+o*a;return u>0};T.isObtuse=function(t,e,r){var i=t.x-e.x,o=t.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*s+o*a;return u<0};T.interiorAngle=function(t,e,r){var i=T.angle(e,t),o=T.angle(e,r);return Math.abs(o-i)};T.normalizePositive=function(t){if(t<0){for(;t<0;)t+=T.PI_TIMES_2;t>=T.PI_TIMES_2&&(t=0)}else{for(;t>=T.PI_TIMES_2;)t-=T.PI_TIMES_2;t<0&&(t=0)}return t};T.angleBetween=function(t,e,r){var i=T.angle(e,t),o=T.angle(e,r);return T.diff(i,o)};T.diff=function(t,e){var r=null;return t<e?r=e-t:r=t-e,r>Math.PI&&(r=2*Math.PI-r),r};T.toRadians=function(t){return t*Math.PI/180};T.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?T.COUNTERCLOCKWISE:r<0?T.CLOCKWISE:T.NONE};T.angleBetweenOriented=function(t,e,r){var i=T.angle(e,t),o=T.angle(e,r),s=o-i;return s<=-Math.PI?s+T.PI_TIMES_2:s>Math.PI?s-T.PI_TIMES_2:s};qr.PI_TIMES_2.get=function(){return 2*Math.PI};qr.PI_OVER_2.get=function(){return Math.PI/2};qr.PI_OVER_4.get=function(){return Math.PI/4};qr.COUNTERCLOCKWISE.get=function(){return I.COUNTERCLOCKWISE};qr.CLOCKWISE.get=function(){return I.CLOCKWISE};qr.NONE.get=function(){return I.COLLINEAR};Object.defineProperties(T,qr);var Y=function n(){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 x,this._seg1=new x,this._offset0=new x,this._offset1=new x,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Sr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===G.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Mn={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}};Y.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 r=I.computeOrientation(this._s0,this._s1,this._s2),i=r===I.CLOCKWISE&&this._side===v.LEFT||r===I.COUNTERCLOCKWISE&&this._side===v.RIGHT;r===0?this.addCollinear(e):i?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)};Y.prototype.addLineEndCap=function(t,e){var r=new x(t,e),i=new x;this.computeOffsetSegment(r,v.LEFT,this._distance,i);var o=new x;this.computeOffsetSegment(r,v.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case G.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,I.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case G.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case G.CAP_SQUARE:var l=new p;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new p(i.p1.x+l.x,i.p1.y+l.y),f=new p(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}};Y.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};Y.prototype.addMitreJoin=function(t,e,r,i){var o=!0,s=null;try{s=re.intersection(e.p0,e.p1,r.p0,r.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof ln)s=new p(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,r,i,this._bufParams.getMitreLimit())};Y.prototype.addFilletCorner=function(t,e,r,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=r.x-t.x,c=r.y-t.y,f=Math.atan2(c,l);i===I.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(r)};Y.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Y.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===G.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===G.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))};Y.prototype.createSquare=function(t){this._segList.addPt(new p(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new p(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new p(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new p(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()};Y.prototype.addSegments=function(t,e){this._segList.addPts(t,e)};Y.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)};Y.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)};Y.prototype.initSideSegments=function(t,e,r){this._s1=t,this._s2=e,this._side=r,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)};Y.prototype.addLimitedMitreJoin=function(t,e,r,i){var o=this._seg0.p1,s=T.angle(o,this._seg0.p0),a=T.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=T.normalize(s+u),c=T.normalize(l+Math.PI),f=i*r,g=f*Math.abs(Math.sin(u)),m=r-g,_=o.x+f*Math.cos(c),E=o.y+f*Math.sin(c),C=new p(_,E),S=new x(o,C),A=S.pointAlongOffset(1,m),F=S.pointAlongOffset(1,-m);this._side===v.LEFT?(this._segList.addPt(A),this._segList.addPt(F)):(this._segList.addPt(F),this._segList.addPt(A))};Y.prototype.computeOffsetSegment=function(t,e,r,i){var o=e===v.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*r*s/u,c=o*r*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l};Y.prototype.addFilletArc=function(t,e,r,i,o){var s=this,a=i===I.CLOCKWISE?-1:1,u=Math.abs(e-r),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,g=c,m=new p;g<u;){var _=e+a*g;m.x=t.x+o*Math.cos(_),m.y=t.y+o*Math.sin(_),s._segList.addPt(m),g+=f}};Y.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*Y.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new p((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(r);var i=new p((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(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};Y.prototype.createCircle=function(t){var e=new p(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Y.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)};Y.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Xt,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Y.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Y.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===G.JOIN_BEVEL||this._bufParams.getJoinStyle()===G.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,I.CLOCKWISE,this._distance))};Y.prototype.closeRing=function(){this._segList.closeRing()};Y.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Y.prototype.interfaces_=function(){return[]};Y.prototype.getClass=function(){return Y};Mn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};Mn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Y,Mn);var Rt=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Rt.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var r=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,r,o);var s=o.getCoordinates();return r&&R.reverse(s),s};Rt.prototype.computeSingleSidedBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var o=J.simplify(t,-i),s=o.length-1;r.initSideSegments(o[s],o[s-1],v.LEFT),r.addFirstSegment();for(var a=s-2;a>=0;a--)r.addNextSegment(o[a],!0)}else{r.addSegments(t,!1);var u=J.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],v.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment(),r.closeRing()};Rt.prototype.computeRingBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);e===v.RIGHT&&(i=-i);var o=J.simplify(t,i),s=o.length-1;r.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;r.addNextSegment(o[a],u)}r.closeRing()};Rt.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),i=J.simplify(t,r),o=i.length-1;e.initSideSegments(i[0],i[1],v.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=J.simplify(t,-r),u=a.length-1;e.initSideSegments(a[u],a[u-1],v.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()};Rt.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case G.CAP_ROUND:e.createCircle(t);break;case G.CAP_SQUARE:e.createSquare(t);break}};Rt.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var r=Math.abs(e),i=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s};Rt.prototype.getBufferParameters=function(){return this._bufParams};Rt.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};Rt.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return Rt.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()};Rt.prototype.computeOffsetCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){var o=J.simplify(t,-i),s=o.length-1;r.initSideSegments(o[s],o[s-1],v.LEFT),r.addFirstSegment();for(var a=s-2;a>=0;a--)r.addNextSegment(o[a],!0)}else{var u=J.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],v.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment()};Rt.prototype.getSegGen=function(t){return new Y(this._precisionModel,this._bufParams,t)};Rt.prototype.interfaces_=function(){return[]};Rt.prototype.getClass=function(){return Rt};Rt.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;r<e.length;r++)e[r]=new p(t[r]);return e};var Dr=function(){this._subgraphs=null,this._seg=new x,this._cga=new I;var t=arguments[0];this._subgraphs=t},Bi={DepthSegment:{configurable:!0}};Dr.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=new y,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(P(arguments[2],ne)&&arguments[0]instanceof p&&arguments[1]instanceof $n)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var g=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(g<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&I.computeOrientation(t._seg.p0,t._seg.p1,a)!==I.RIGHT){var m=u.getDepth(v.LEFT);t._seg.p0.equals(c[f])||(m=u.getDepth(v.RIGHT));var _=new _r(t._seg,m);l.add(_)}}else if(P(arguments[2],ne)&&arguments[0]instanceof p&&P(arguments[1],ne))for(var E=arguments[0],C=arguments[1],S=arguments[2],A=C.iterator();A.hasNext();){var F=A.next();F.isForward()&&t.findStabbedSegments(E,F,S)}}};Dr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var r=ae.min(e);return r._leftDepth};Dr.prototype.interfaces_=function(){return[]};Dr.prototype.getClass=function(){return Dr};Bi.DepthSegment.get=function(){return _r};Object.defineProperties(Dr,Bi);var _r=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new x(t),this._leftDepth=e};_r.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 r=this._upwardSeg.orientationIndex(e._upwardSeg);return r!==0||(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(e._upwardSeg)};_r.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return r!==0?r:t.p1.compareTo(e.p1)};_r.prototype.toString=function(){return this._upwardSeg.toString()};_r.prototype.interfaces_=function(){return[$t]};_r.prototype.getClass=function(){return _r};var z=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};z.prototype.area=function(){return z.area(this.p0,this.p1,this.p2)};z.prototype.signedArea=function(){return z.signedArea(this.p0,this.p1,this.p2)};z.prototype.interpolateZ=function(t){if(t===null)throw new H("Supplied point is null.");return z.interpolateZ(t,this.p0,this.p1,this.p2)};z.prototype.longestSideLength=function(){return z.longestSideLength(this.p0,this.p1,this.p2)};z.prototype.isAcute=function(){return z.isAcute(this.p0,this.p1,this.p2)};z.prototype.circumcentre=function(){return z.circumcentre(this.p0,this.p1,this.p2)};z.prototype.area3D=function(){return z.area3D(this.p0,this.p1,this.p2)};z.prototype.centroid=function(){return z.centroid(this.p0,this.p1,this.p2)};z.prototype.inCentre=function(){return z.inCentre(this.p0,this.p1,this.p2)};z.prototype.interfaces_=function(){return[]};z.prototype.getClass=function(){return z};z.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)};z.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2};z.det=function(t,e,r,i){return t*i-e*r};z.interpolateZ=function(t,e,r,i){var o=e.x,s=e.y,a=r.x-o,u=i.x-o,l=r.y-s,c=i.y-s,f=a*c-u*l,g=t.x-o,m=t.y-s,_=(c*g-u*m)/f,E=(-l*g+a*m)/f,C=e.z+_*(r.z-e.z)+E*(i.z-e.z);return C};z.longestSideLength=function(t,e,r){var i=t.distance(e),o=e.distance(r),s=r.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a};z.isAcute=function(t,e,r){return!(!T.isAcute(t,e,r)||!T.isAcute(e,r,t)||!T.isAcute(r,t,e))};z.circumcentre=function(t,e,r){var i=r.x,o=r.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*z.det(s,a,u,l),f=z.det(a,s*s+a*a,l,u*u+l*l),g=z.det(s,s*s+a*a,u,u*u+l*l),m=i-f/c,_=o+g/c;return new p(m,_)};z.perpendicularBisector=function(t,e){var r=e.x-t.x,i=e.y-t.y,o=new re(t.x+r/2,t.y+i/2,1),s=new re(t.x-i+r/2,t.y+r+i/2,1);return new re(o,s)};z.angleBisector=function(t,e,r){var i=e.distance(t),o=e.distance(r),s=i/(i+o),a=r.x-t.x,u=r.y-t.y,l=new p(t.x+s*a,t.y+s*u);return l};z.area3D=function(t,e,r){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=r.x-t.x,u=r.y-t.y,l=r.z-t.z,c=o*l-s*u,f=s*a-i*l,g=i*u-o*a,m=c*c+f*f+g*g,_=Math.sqrt(m)/2;return _};z.centroid=function(t,e,r){var i=(t.x+e.x+r.x)/3,o=(t.y+e.y+r.y)/3;return new p(i,o)};z.inCentre=function(t,e,r){var i=e.distance(r),o=t.distance(r),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*r.x)/a,l=(i*t.y+o*e.y+s*r.y)/a;return new p(u,l)};var Zt=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new y;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Zt.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,h.EXTERIOR,h.INTERIOR)};Zt.prototype.addPolygon=function(t){var e=this,r=this._distance,i=v.LEFT;this._distance<0&&(r=-this._distance,i=v.RIGHT);var o=t.getExteriorRing(),s=R.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,r,i,h.EXTERIOR,h.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=R.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,r,v.opposite(i),h.INTERIOR,h.EXTERIOR)}};Zt.prototype.isTriangleErodedCompletely=function(t,e){var r=new z(t[0],t[1],t[2]),i=r.inCentre(),o=I.distancePointLine(i,r.p0,r.p1);return o<Math.abs(e)};Zt.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=R.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,h.EXTERIOR,h.INTERIOR)};Zt.prototype.addCurve=function(t,e,r){if(t===null||t.length<2)return null;var i=new tt(t,new U(0,h.BOUNDARY,e,r));this._curveList.add(i)};Zt.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList};Zt.prototype.addPolygonRing=function(t,e,r,i,o){if(e===0&&t.length<Me.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Me.MINIMUM_VALID_SIZE&&I.isCCW(t)&&(s=o,a=i,r=v.opposite(r));var u=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(u,s,a)};Zt.prototype.add=function(t){if(t.isEmpty())return null;t instanceof st?this.addPolygon(t):t instanceof K?this.addLineString(t):t instanceof Ft?this.addPoint(t):t instanceof Qr?this.addCollection(t):t instanceof mr?this.addCollection(t):t instanceof be?this.addCollection(t):t instanceof Lt&&this.addCollection(t)};Zt.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(r.length===4)return this.isTriangleErodedCompletely(r,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o};Zt.prototype.addCollection=function(t){for(var e=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);e.add(i)}};Zt.prototype.interfaces_=function(){return[]};Zt.prototype.getClass=function(){return Zt};var en=function(){};en.prototype.locate=function(t){};en.prototype.interfaces_=function(){return[]};en.prototype.getClass=function(){return en};var Re=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()};Re.prototype.next=function(){if(this._atStart)return this._atStart=!1,Re.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new fn;var t=this._parent.getGeometryN(this._index++);return t instanceof Lt?(this._subcollectionIterator=new Re(t),this._subcollectionIterator.next()):t};Re.prototype.remove=function(){throw new Error(this.getClass().getName())};Re.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};Re.prototype.interfaces_=function(){return[cn]};Re.prototype.getClass=function(){return Re};Re.isAtomic=function(t){return!(t instanceof Lt)};var Ut=function(){this._geom=null;var t=arguments[0];this._geom=t};Ut.prototype.locate=function(t){return Ut.locate(t,this._geom)};Ut.prototype.interfaces_=function(){return[en]};Ut.prototype.getClass=function(){return Ut};Ut.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?I.isPointInRing(t,e.getCoordinates()):!1};Ut.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Ut.isPointInRing(t,r))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Ut.isPointInRing(t,o))return!1}return!0};Ut.containsPoint=function(t,e){if(e instanceof st)return Ut.containsPointInPolygon(t,e);if(e instanceof Lt)for(var r=new Re(e);r.hasNext();){var i=r.next();if(i!==e&&Ut.containsPoint(t,i))return!0}return!1};Ut.locate=function(t,e){return e.isEmpty()?h.EXTERIOR:Ut.containsPoint(t,e)?h.INTERIOR:h.EXTERIOR};var It=function(){this._edgeMap=new _t,this._edgeList=null,this._ptInAreaLocation=[h.NONE,h.NONE]};It.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),r=e-1;return e===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)};It.prototype.propagateSideLabels=function(t){for(var e=h.NONE,r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,v.LEFT)!==h.NONE&&(e=o.getLocation(t,v.LEFT))}if(e===h.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,v.ON)===h.NONE&&l.setLocation(t,v.ON,s),l.isArea(t)){var c=l.getLocation(t,v.LEFT),f=l.getLocation(t,v.RIGHT);if(f!==h.NONE){if(f!==s)throw new Je("side location conflict",u.getCoordinate());c===h.NONE&&D.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else D.isTrue(l.getLocation(t,v.LEFT)===h.NONE,"found single null side"),l.setLocation(t,v.RIGHT,s),l.setLocation(t,v.LEFT,s)}}};It.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()};It.prototype.print=function(t){ht.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}};It.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)};It.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var r=e.size()-1,i=e.get(r).getLabel(),o=i.getLocation(t,v.LEFT);D.isTrue(o!==h.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();D.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,v.LEFT),f=l.getLocation(t,v.RIGHT);if(c===f||f!==s)return!1;s=c}return!0};It.prototype.findIndex=function(t){var e=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=e._edgeList.get(r);if(i===t)return r}return-1};It.prototype.iterator=function(){return this.getEdges().iterator()};It.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new y(this._edgeMap.values())),this._edgeList};It.prototype.getLocation=function(t,e,r){return this._ptInAreaLocation[t]===h.NONE&&(this._ptInAreaLocation[t]=Ut.locate(e,r[t].getGeometry())),this._ptInAreaLocation[t]};It.prototype.toString=function(){var t=new we;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
3
- `);for(var e=this.iterator();e.hasNext();){var r=e.next();t.append(r),t.append(`
4
- `)}return t.toString()};It.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}};It.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===h.BOUNDARY&&(r[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var g=h.NONE;if(r[f])g=h.EXTERIOR;else{var m=l.getCoordinate();g=e.getLocation(f,m,t)}c.setAllLocationsIfNull(f,g)}};It.prototype.getDegree=function(){return this._edgeMap.size()};It.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null};It.prototype.interfaces_=function(){return[]};It.prototype.getClass=function(){return It};var ho=function(n){function t(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=r._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=r._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Je("no outgoing dirEdge found",this.getCoordinate());D.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var o=r.get(0);if(i===1)return o;var s=r.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return q.isNorthern(a)&&q.isNorthern(u)?o:!q.isNorthern(a)&&!q.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(D.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){ht.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();r.print("out "),o.print(r),r.println(),r.print("in "),o.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new y;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&r._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,r.getLocation(0)),s.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=r._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(v.LEFT),a=i.getDepth(v.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Je("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],g=arguments[2],m=g,_=c;_<f;_++){var E=r._edgeList.get(_);E.setEdgeDepths(v.RIGHT,m),m=E.getDepth(v.LEFT)}return m}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===r&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==r)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(D.isTrue(o!==null,"found null for first outgoing dirEdge"),D.isTrue(o.getEdgeRing()===r,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&r++}return r}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=h.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){r=h.INTERIOR;break}if(s.isInResult()){r=h.EXTERIOR;break}}}if(r===h.NONE)return null;for(var a=r,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===h.INTERIOR):(l.isInResult()&&(a=h.EXTERIOR),c.isInResult()&&(a=h.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new U(h.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===h.INTERIOR||c===h.BOUNDARY)&&i._label.setLocation(l,h.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(It),Gi=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Kn(r,new ho)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Zr),ar=function n(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=n.orientation(t)};ar.prototype.compareTo=function(t){var e=t,r=ar.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r};ar.prototype.interfaces_=function(){return[$t]};ar.prototype.getClass=function(){return ar};ar.orientation=function(t){return R.increasingDirection(t)===1};ar.compareOriented=function(t,e,r,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,c=i?0:r.length-1;;){var f=t[l].compareTo(r[c]);if(f!==0)return f;l+=o,c+=s;var g=l===a,m=c===u;if(g&&!m)return-1;if(!g&&m)return 1;if(g&&m)return 0}};var ue=function(){this._edges=new y,this._ocaMap=new _t};ue.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")};ue.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())};ue.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1};ue.prototype.iterator=function(){return this._edges.iterator()};ue.prototype.getEdges=function(){return this._edges};ue.prototype.get=function(t){return this._edges.get(t)};ue.prototype.findEqualEdge=function(t){var e=new ar(t.getCoordinates()),r=this._ocaMap.get(e);return r};ue.prototype.add=function(t){this._edges.add(t);var e=new ar(t.getCoordinates());this._ocaMap.put(e,t)};ue.prototype.interfaces_=function(){return[]};ue.prototype.getClass=function(){return ue};var yr=function(){};yr.prototype.processIntersections=function(t,e,r,i){};yr.prototype.isDone=function(){};yr.prototype.interfaces_=function(){return[]};yr.prototype.getClass=function(){return yr};var Yt=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};Yt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Yt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1};Yt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Yt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Yt.prototype.getLineIntersector=function(){return this._li};Yt.prototype.hasProperIntersection=function(){return this._hasProper};Yt.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))};Yt.prototype.hasIntersection=function(){return this._hasIntersection};Yt.prototype.isDone=function(){return!1};Yt.prototype.hasInteriorIntersection=function(){return this._hasInterior};Yt.prototype.interfaces_=function(){return[yr]};Yt.prototype.getClass=function(){return Yt};Yt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var xe=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new p(t),this.segmentIndex=e,this.dist=r};xe.prototype.getSegmentIndex=function(){return this.segmentIndex};xe.prototype.getCoordinate=function(){return this.coord};xe.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)};xe.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)};xe.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t};xe.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist};xe.prototype.getDistance=function(){return this.dist};xe.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0};xe.prototype.interfaces_=function(){return[$t]};xe.prototype.getClass=function(){return xe};var Be=function(){this._nodeMap=new _t,this.edge=null;var t=arguments[0];this.edge=t};Be.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}};Be.prototype.iterator=function(){return this._nodeMap.values().iterator()};Be.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}};Be.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)};Be.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new p(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r.edge.pts[l];return s&&(a[u]=e.coord),new Bn(a,new U(this.edge._label))};Be.prototype.add=function(t,e,r){var i=new xe(t,e,r),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)};Be.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1};Be.prototype.interfaces_=function(){return[]};Be.prototype.getClass=function(){return Be};var Ir=function(){};Ir.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new y;i.add(new _e(r));do{var o=e.findChainEnd(t,r);i.add(new _e(o)),r=o}while(r<t.length-1);var s=Ir.toIntArray(i);return s};Ir.prototype.findChainEnd=function(t,e){for(var r=q.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=q.quadrant(t[i-1],t[i]);if(o!==r)break;i++}return i-1};Ir.prototype.interfaces_=function(){return[]};Ir.prototype.getClass=function(){return Ir};Ir.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var Ze=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new N,this.env2=new N;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Ir;this.startIndex=e.getChainStartIndices(this.pts)};Ze.prototype.getCoordinates=function(){return this.pts};Ze.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r};Ze.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r};Ze.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],g=this.pts[s],m=a.pts[u],_=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,g),this.env2.init(m,_),!this.env1.intersects(this.env2))return null;var E=Math.trunc((o+s)/2),C=Math.trunc((u+l)/2);o<E&&(u<C&&this.computeIntersectsForChain(o,E,a,u,C,c),C<l&&this.computeIntersectsForChain(o,E,a,C,l,c)),E<s&&(u<C&&this.computeIntersectsForChain(E,s,a,u,C,c),C<l&&this.computeIntersectsForChain(E,s,a,C,l,c))}};Ze.prototype.getStartIndexes=function(){return this.startIndex};Ze.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)r.computeIntersectsForChain(i,t,o,e)};Ze.prototype.interfaces_=function(){return[]};Ze.prototype.getClass=function(){return Ze};var pt=function n(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=n.NULL_VALUE},Vi={NULL_VALUE:{configurable:!0}};pt.prototype.getDepth=function(t,e){return this._depth[t][e]};pt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r};pt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==pt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===pt.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===pt.NULL_VALUE}};pt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>r&&(o=1),t._depth[e][i]=o}}};pt.prototype.getDelta=function(t){return this._depth[t][v.RIGHT]-this._depth[t][v.LEFT]};pt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?h.EXTERIOR:h.INTERIOR};pt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};pt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var o=e.getLocation(r,i);(o===h.EXTERIOR||o===h.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=pt.depthAtLocation(o):t._depth[r][i]+=pt.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===h.INTERIOR&&this._depth[s][a]++}};pt.prototype.interfaces_=function(){return[]};pt.prototype.getClass=function(){return pt};pt.depthAtLocation=function(t){return t===h.EXTERIOR?0:t===h.INTERIOR?1:pt.NULL_VALUE};Vi.NULL_VALUE.get=function(){return-1};Object.defineProperties(pt,Vi);var Bn=function(n){function t(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new Be(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new pt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,U.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var o=r;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&r.print(","),r.print(i.pts[o].x+" "+i.pts[o].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)r.print(i.pts[o]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ze(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new N;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,o,s){var a=new p(r.getIntersection(s)),u=i,l=r.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var r=this,i=new we;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(r.pts[o].x+" "+r.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(r.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,o){for(var s=this,a=0;a<r.getIntersectionNum();a++)s.addIntersection(r,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,v.ON),r.getLocation(1,v.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,v.LEFT),r.getLocation(1,v.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,v.RIGHT),r.getLocation(1,v.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},t}(kt),St=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new ue,this._bufParams=t||null};St.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t};St.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new U(t.getLabel()),i.flip()),r.merge(i);var o=St.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(St.depthDelta(t.getLabel()))};St.prototype.buildSubgraphs=function(t,e){for(var r=new y,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new Dr(r),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),r.add(o),e.add(o.getDirectedEdges(),o.getNodes())}};St.prototype.createSubgraphs=function(t){for(var e=new y,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var o=new Pt;o.create(i),e.add(o)}}return ae.sort(e,ae.reverseOrder()),e};St.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t};St.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new ui,r=new Sr;return r.setPrecisionModel(t),e.setSegmentIntersector(new Yt(r)),e};St.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new Rt(r,this._bufParams),o=new Zt(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,r),this._graph=new j(new Gi),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new Bt(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c};St.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Bn(a.getCoordinates(),new U(l));r.insertUniqueEdge(c)}}};St.prototype.setNoder=function(t){this._workingNoder=t};St.prototype.interfaces_=function(){return[]};St.prototype.getClass=function(){return St};St.depthDelta=function(t){var e=t.getLocation(0,v.LEFT),r=t.getLocation(0,v.RIGHT);return e===h.INTERIOR&&r===h.EXTERIOR?1:e===h.EXTERIOR&&r===h.INTERIOR?-1:0};St.convertSegStrings=function(t){for(var e=new b,r=new y;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());r.add(o)}return e.buildGeometry(r)};var ur=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};ur.prototype.rescale=function(){var t=this;if(P(arguments[0],it))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&ht.out.println(o)}};ur.prototype.scale=function(){var t=this;if(P(arguments[0],it)){for(var e=arguments[0],r=new y,i=e.iterator();i.hasNext();){var o=i.next();r.add(new tt(t.scale(o.getCoordinates()),o.getData()))}return r}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new p(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=R.removeRepeatedPoints(a);return l}};ur.prototype.isIntegerPrecision=function(){return this._scaleFactor===1};ur.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t};ur.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)};ur.prototype.interfaces_=function(){return[vr]};ur.prototype.getClass=function(){return ur};var Se=function(){this._li=new Sr,this._segStrings=null;var t=arguments[0];this._segStrings=t},zi={fact:{configurable:!0}};Se.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new je("found endpt/interior pt intersection at index "+c+" :pt "+o)}};Se.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(r,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var g=arguments[0],m=arguments[1],_=arguments[2],E=arguments[3];if(g===_&&m===E)return null;var C=g.getCoordinates()[m],S=g.getCoordinates()[m+1],A=_.getCoordinates()[E],F=_.getCoordinates()[E+1];if(this._li.computeIntersection(C,S,A,F),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,C,S)||this.hasInteriorIntersection(this._li,A,F)))throw new je("found non-noded intersection at "+C+"-"+S+" and "+A+"-"+F)}};Se.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()};Se.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])};Se.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(r)))return!0}return!1};Se.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new je("found non-noded collapse at "+Se.fact.createLineString([t,e,r]))};Se.prototype.interfaces_=function(){return[]};Se.prototype.getClass=function(){return Se};zi.fact.get=function(){return new b};Object.defineProperties(Se,zi);var Tt=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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new H("Scale factor must be non-zero");e!==1&&(this._pt=new p(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new p,this._p1Scaled=new p),this.initCorners(this._pt)},Ui={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Tt.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<r||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return D.isTrue(!(a&&u),"Found bad envelope test"),u};Tt.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 p(this._maxx,this._maxy),this._corner[1]=new p(this._minx,this._maxy),this._corner[2]=new p(this._minx,this._miny),this._corner[3]=new p(this._maxx,this._miny)};Tt.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};Tt.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};Tt.prototype.getCoordinate=function(){return this._originalPt};Tt.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)};Tt.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Tt.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new N(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};Tt.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()))};Tt.prototype.intersectsToleranceSquare=function(t,e){var r=!1,i=!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()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||t.equals(this._pt)||e.equals(this._pt))};Tt.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1};Tt.prototype.interfaces_=function(){return[]};Tt.prototype.getClass=function(){return Tt};Ui.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(Tt,Ui);var xn=function(){this.tempEnv1=new N,this.selectedSegment=new x};xn.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}};xn.prototype.interfaces_=function(){return[]};xn.prototype.getClass=function(){return xn};var rn=function(){this._index=null;var t=arguments[0];this._index=t},qi={HotPixelSnapAction:{configurable:!0}};rn.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new ki(e,r,i);return this._index.query(o,{interfaces_:function(){return[or]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}};rn.prototype.interfaces_=function(){return[]};rn.prototype.getClass=function(){return rn};qi.HotPixelSnapAction.get=function(){return ki};Object.defineProperties(rn,qi);var ki=function(n){function t(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],o=r.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return n.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xn),br=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new y};br.prototype.processIntersections=function(t,e,r,i){var o=this;if(t===r&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}};br.prototype.isDone=function(){return!1};br.prototype.getInteriorIntersections=function(){return this._interiorIntersections};br.prototype.interfaces_=function(){return[yr]};br.prototype.getClass=function(){return br};var Ge=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 Sr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Ge.prototype.checkCorrectness=function(t){var e=tt.getNodedSubstrings(t),r=new Se(e);try{r.checkValid()}catch(i){if(i instanceof Li)i.printStackTrace();else throw i}finally{}};Ge.prototype.getNodedSubstrings=function(){return tt.getNodedSubstrings(this._nodedSegStrings)};Ge.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)};Ge.prototype.findInteriorIntersections=function(t,e){var r=new br(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()};Ge.prototype.computeVertexSnaps=function(){var t=this;if(P(arguments[0],it))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof tt)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new Tt(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}};Ge.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ui,this._pointSnapper=new rn(this._noder.getIndex()),this.snapRound(t,this._li)};Ge.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),o=new Tt(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}};Ge.prototype.interfaces_=function(){return[vr]};Ge.prototype.getClass=function(){return Ge};var ft=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new G,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._argGeom=e,this._bufParams=r}},pn={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};ft.prototype.bufferFixedPrecision=function(t){var e=new ur(new Ge(new V(1)),t.getScale()),r=new St(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)};ft.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=ft.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Je)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=ft.precisionScaleFactor(this._argGeom,this._distance,r),o=new V(i);this.bufferFixedPrecision(o)}};ft.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===V.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};ft.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};ft.prototype.bufferOriginalPrecision=function(){try{var t=new St(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof je)this._saveException=e;else throw e}finally{}};ft.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};ft.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};ft.prototype.interfaces_=function(){return[]};ft.prototype.getClass=function(){return ft};ft.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new ft(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof L&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new ft(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof G&&arguments[0]instanceof L&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],g=arguments[2],m=new ft(c,g),_=m.getResultGeometry(f);return _}}else if(arguments.length===4){var E=arguments[0],C=arguments[1],S=arguments[2],A=arguments[3],F=new ft(E);F.setQuadrantSegments(S),F.setEndCapStyle(A);var Et=F.getResultGeometry(C);return Et}};ft.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),o=qt.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=r-u,c=Math.pow(10,l);return c};pn.CAP_ROUND.get=function(){return G.CAP_ROUND};pn.CAP_BUTT.get=function(){return G.CAP_FLAT};pn.CAP_FLAT.get=function(){return G.CAP_FLAT};pn.CAP_SQUARE.get=function(){return G.CAP_SQUARE};pn.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(ft,pn);var Nt=function(){this._pt=[new p,new p],this._distance=w.NaN,this._isNull=!0};Nt.prototype.getCoordinates=function(){return this._pt};Nt.prototype.getCoordinate=function(t){return this._pt[t]};Nt.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}};Nt.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}};Nt.prototype.getDistance=function(){return this._distance};Nt.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}};Nt.prototype.interfaces_=function(){return[]};Nt.prototype.getClass=function(){return Nt};var De=function(){};De.prototype.interfaces_=function(){return[]};De.prototype.getClass=function(){return De};De.computeDistance=function(){if(arguments[2]instanceof Nt&&arguments[0]instanceof K&&arguments[1]instanceof p)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),o=new x,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof Nt&&arguments[0]instanceof st&&arguments[1]instanceof p){var u=arguments[0],l=arguments[1],c=arguments[2];De.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)De.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof Nt&&arguments[0]instanceof L&&arguments[1]instanceof p){var g=arguments[0],m=arguments[1],_=arguments[2];if(g instanceof K)De.computeDistance(g,m,_);else if(g instanceof st)De.computeDistance(g,m,_);else if(g instanceof Lt)for(var E=g,C=0;C<E.getNumGeometries();C++){var S=E.getGeometryN(C);De.computeDistance(S,m,_)}else _.setMinimum(g.getCoordinate(),m)}else if(arguments[2]instanceof Nt&&arguments[0]instanceof x&&arguments[1]instanceof p){var A=arguments[0],F=arguments[1],Et=arguments[2],ee=A.closestPoint(F);Et.setMinimum(ee,F)}};var Er=function(t){this._maxPtDist=new Nt,this._inputGeom=t||null},li={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Er.prototype.computeMaxMidpointDistance=function(t){var e=new lr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())};Er.prototype.computeMaxVertexDistance=function(t){var e=new Rr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())};Er.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()};Er.prototype.getDistancePoints=function(){return this._maxPtDist};Er.prototype.interfaces_=function(){return[]};Er.prototype.getClass=function(){return Er};li.MaxPointDistanceFilter.get=function(){return Rr};li.MaxMidpointDistanceFilter.get=function(){return lr};Object.defineProperties(Er,li);var Rr=function(t){this._maxPtDist=new Nt,this._minPtDist=new Nt,this._geom=t||null};Rr.prototype.filter=function(t){this._minPtDist.initialize(),De.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};Rr.prototype.getMaxPointDistance=function(){return this._maxPtDist};Rr.prototype.interfaces_=function(){return[Te]};Rr.prototype.getClass=function(){return Rr};var lr=function(t){this._maxPtDist=new Nt,this._minPtDist=new Nt,this._geom=t||null};lr.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new p((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),De.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};lr.prototype.isDone=function(){return!1};lr.prototype.isGeometryChanged=function(){return!1};lr.prototype.getMaxPointDistance=function(){return this._maxPtDist};lr.prototype.interfaces_=function(){return[oe]};lr.prototype.getClass=function(){return lr};var We=function(t){this._comps=t||null};We.prototype.filter=function(t){t instanceof st&&this._comps.add(t)};We.prototype.interfaces_=function(){return[Ie]};We.prototype.getClass=function(){return We};We.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return We.getPolygons(t,new y)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof st?r.add(e):e instanceof Lt&&e.apply(new We(r)),r}};var ct=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};ct.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Me){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof K&&this._lines.add(t)};ct.prototype.setForceToLineString=function(t){this._isForcedToLineString=t};ct.prototype.interfaces_=function(){return[Ke]};ct.prototype.getClass=function(){return ct};ct.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(ct.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(ct.getLines(e,r))}};ct.getLines=function(){if(arguments.length===1){var t=arguments[0];return ct.getLines(t,!1)}else if(arguments.length===2){if(P(arguments[0],it)&&P(arguments[1],it)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();ct.getLines(o,r)}return r}else if(arguments[0]instanceof L&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new y;return s.apply(new ct(u,a)),u}else if(arguments[0]instanceof L&&P(arguments[1],it)){var l=arguments[0],c=arguments[1];return l instanceof K?c.add(l):l.apply(new ct(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&P(arguments[0],it)&&P(arguments[1],it)){for(var f=arguments[0],g=arguments[1],m=arguments[2],_=f.iterator();_.hasNext();){var E=_.next();ct.getLines(E,g,m)}return g}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof L&&P(arguments[1],it)){var C=arguments[0],S=arguments[1],A=arguments[2];return C.apply(new ct(S,A)),S}}};var le=function(){if(this._boundaryRule=Jt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new H("Rule must be non-null");this._boundaryRule=t}}};le.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof p&&arguments[1]instanceof st){var e=arguments[0],r=arguments[1];if(r.isEmpty())return h.EXTERIOR;var i=r.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===h.EXTERIOR)return h.EXTERIOR;if(o===h.BOUNDARY)return h.BOUNDARY;for(var s=0;s<r.getNumInteriorRing();s++){var a=r.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===h.INTERIOR)return h.EXTERIOR;if(u===h.BOUNDARY)return h.BOUNDARY}return h.INTERIOR}else if(arguments[0]instanceof p&&arguments[1]instanceof K){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return h.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?h.BOUNDARY:I.isOnLine(l,f)?h.INTERIOR:h.EXTERIOR}else if(arguments[0]instanceof p&&arguments[1]instanceof Ft){var g=arguments[0],m=arguments[1],_=m.getCoordinate();return _.equals2D(g)?h.INTERIOR:h.EXTERIOR}};le.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?I.locatePointInRing(t,e.getCoordinates()):h.EXTERIOR};le.prototype.intersects=function(t,e){return this.locate(t,e)!==h.EXTERIOR};le.prototype.updateLocationInfo=function(t){t===h.INTERIOR&&(this._isIn=!0),t===h.BOUNDARY&&this._numBoundaries++};le.prototype.computeLocation=function(t,e){var r=this;if(e instanceof Ft&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof K)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof st)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof mr)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);r.updateLocationInfo(r.locateInternal(t,s))}else if(e instanceof be)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof Lt)for(var c=new Re(e);c.hasNext();){var f=c.next();f!==e&&r.computeLocation(t,f)}};le.prototype.locate=function(t,e){return e.isEmpty()?h.EXTERIOR:e instanceof K?this.locateInternal(t,e):e instanceof st?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?h.BOUNDARY:this._numBoundaries>0||this._isIn?h.INTERIOR:h.EXTERIOR)};le.prototype.interfaces_=function(){return[]};le.prototype.getClass=function(){return le};var xt=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];n.call(this,t,n.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Xi={INSIDE_AREA:{configurable:!0}};xt.prototype.isInsideArea=function(){return this._segIndex===xt.INSIDE_AREA};xt.prototype.getCoordinate=function(){return this._pt};xt.prototype.getGeometryComponent=function(){return this._component};xt.prototype.getSegmentIndex=function(){return this._segIndex};xt.prototype.interfaces_=function(){return[]};xt.prototype.getClass=function(){return xt};Xi.INSIDE_AREA.get=function(){return-1};Object.defineProperties(xt,Xi);var rr=function(t){this._pts=t||null};rr.prototype.filter=function(t){t instanceof Ft&&this._pts.add(t)};rr.prototype.interfaces_=function(){return[Ie]};rr.prototype.getClass=function(){return rr};rr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Ft?ae.singletonList(t):rr.getPoints(t,new y)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Ft?r.add(e):e instanceof Lt&&e.apply(new rr(r)),r}};var Tr=function(){this._locations=null;var t=arguments[0];this._locations=t};Tr.prototype.filter=function(t){(t instanceof Ft||t instanceof K||t instanceof st)&&this._locations.add(new xt(t,0,t.getCoordinate()))};Tr.prototype.interfaces_=function(){return[Ie]};Tr.prototype.getClass=function(){return Tr};Tr.getLocations=function(t){var e=new y;return t.apply(new Tr(e)),e};var gt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new le,this._minDistanceLocation=null,this._minDistance=w.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=o}};gt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=1-r,s=We.getPolygons(this._geom[r]);if(s.size()>0){var a=Tr.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&P(arguments[0],ne)&&P(arguments[1],ne)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var g=u.get(f),m=0;m<l.size();m++)if(t.computeContainmentDistance(g,l.get(m),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof xt&&arguments[1]instanceof st){var _=arguments[0],E=arguments[1],C=arguments[2],S=_.getCoordinate();if(h.EXTERIOR!==this._ptLocator.locate(S,E))return this._minDistance=0,C[0]=_,C[1]=new xt(E,S),null}}};gt.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,r),i._minDistance<=i._terminateDistance)return null}};gt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=ct.getLines(this._geom[0]),r=ct.getLines(this._geom[1]),i=rr.getPoints(this._geom[0]),o=rr.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)};gt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation};gt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])};gt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t};gt.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof K&&arguments[1]instanceof Ft){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=r.getCoordinate(),a=0;a<o.length-1;a++){var u=I.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new x(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new xt(e,a,c),i[1]=new xt(r,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof K&&arguments[1]instanceof K){var f=arguments[0],g=arguments[1],m=arguments[2];if(f.getEnvelopeInternal().distance(g.getEnvelopeInternal())>this._minDistance)return null;for(var _=f.getCoordinates(),E=g.getCoordinates(),C=0;C<_.length-1;C++)for(var S=0;S<E.length-1;S++){var A=I.distanceLineLine(_[C],_[C+1],E[S],E[S+1]);if(A<t._minDistance){t._minDistance=A;var F=new x(_[C],_[C+1]),Et=new x(E[S],E[S+1]),ee=F.closestPoints(Et);m[0]=new xt(f,C,ee[0]),m[1]=new xt(g,S,ee[1])}if(t._minDistance<=t._terminateDistance)return null}}}};gt.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new xt(s,0,s.getCoordinate()),r[1]=new xt(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}};gt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new H("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)};gt.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,r),i._minDistance<=i._terminateDistance)return null}};gt.prototype.interfaces_=function(){return[]};gt.prototype.getClass=function(){return gt};gt.distance=function(t,e){var r=new gt(t,e);return r.distance()};gt.isWithinDistance=function(t,e,r){var i=new gt(t,e,r);return i.distance()<=r};gt.nearestPoints=function(t,e){var r=new gt(t,e);return r.nearestPoints()};var vt=function(){this._pt=[new p,new p],this._distance=w.NaN,this._isNull=!0};vt.prototype.getCoordinates=function(){return this._pt};vt.prototype.getCoordinate=function(t){return this._pt[t]};vt.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}};vt.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}};vt.prototype.toString=function(){return ie.toLineString(this._pt[0],this._pt[1])};vt.prototype.getDistance=function(){return this._distance};vt.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}};vt.prototype.interfaces_=function(){return[]};vt.prototype.getClass=function(){return vt};var de=function(){};de.prototype.interfaces_=function(){return[]};de.prototype.getClass=function(){return de};de.computeDistance=function(){if(arguments[2]instanceof vt&&arguments[0]instanceof K&&arguments[1]instanceof p)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new x,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof vt&&arguments[0]instanceof st&&arguments[1]instanceof p){var u=arguments[0],l=arguments[1],c=arguments[2];de.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)de.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof vt&&arguments[0]instanceof L&&arguments[1]instanceof p){var g=arguments[0],m=arguments[1],_=arguments[2];if(g instanceof K)de.computeDistance(g,m,_);else if(g instanceof st)de.computeDistance(g,m,_);else if(g instanceof Lt)for(var E=g,C=0;C<E.getNumGeometries();C++){var S=E.getGeometryN(C);de.computeDistance(S,m,_)}else _.setMinimum(g.getCoordinate(),m)}else if(arguments[2]instanceof vt&&arguments[0]instanceof x&&arguments[1]instanceof p){var A=arguments[0],F=arguments[1],Et=arguments[2],ee=A.closestPoint(F);Et.setMinimum(ee,F)}};var Kt=function(){this._g0=null,this._g1=null,this._ptDist=new vt,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},ci={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Kt.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()};Kt.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new H("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};Kt.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)};Kt.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Kt.prototype.computeOrientedDistance=function(t,e,r){var i=new Mr(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new cr(e,this._densifyFrac);t.apply(o),r.setMaximum(o.getMaxPointDistance())}};Kt.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Kt.prototype.interfaces_=function(){return[]};Kt.prototype.getClass=function(){return Kt};Kt.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Kt(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new Kt(i,o);return a.setDensifyFraction(s),a.distance()}};ci.MaxPointDistanceFilter.get=function(){return Mr};ci.MaxDensifiedByFractionDistanceFilter.get=function(){return cr};Object.defineProperties(Kt,ci);var Mr=function(){this._maxPtDist=new vt,this._minPtDist=new vt,this._euclideanDist=new de,this._geom=null;var t=arguments[0];this._geom=t};Mr.prototype.filter=function(t){this._minPtDist.initialize(),de.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};Mr.prototype.getMaxPointDistance=function(){return this._maxPtDist};Mr.prototype.interfaces_=function(){return[Te]};Mr.prototype.getClass=function(){return Mr};var cr=function(){this._maxPtDist=new vt,this._minPtDist=new vt,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};cr.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new p(l,c);r._minPtDist.initialize(),de.computeDistance(r._geom,f,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}};cr.prototype.isDone=function(){return!1};cr.prototype.isGeometryChanged=function(){return!1};cr.prototype.getMaxPointDistance=function(){return this._maxPtDist};cr.prototype.interfaces_=function(){return[oe]};cr.prototype.getClass=function(){return cr};var At=function(t,e,r){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=r||null},fi={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};At.prototype.checkMaximumDistance=function(t,e,r){var i=new Kt(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ie.toLineString(o[0],o[1])+")"}};At.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=At.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),At.VERBOSE&&ht.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};At.prototype.checkNegativeValid=function(){if(!(this._input instanceof st||this._input instanceof be||this._input instanceof Lt))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)};At.prototype.getErrorIndicator=function(){return this._errorIndicator};At.prototype.checkMinimumDistance=function(t,e,r){var i=new gt(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+ie.toLineString(o[0],o[1])+" )"}};At.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)};At.prototype.getErrorLocation=function(){return this._errorLocation};At.prototype.getPolygonLines=function(t){for(var e=new y,r=new ct(e),i=We.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(r)}return t.getFactory().buildGeometry(e)};At.prototype.getErrorMessage=function(){return this._errMsg};At.prototype.interfaces_=function(){return[]};At.prototype.getClass=function(){return At};fi.VERBOSE.get=function(){return!1};fi.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012};Object.defineProperties(At,fi);var dt=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},pi={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};dt.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};dt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*dt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new N(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new N(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")};dt.prototype.checkDistance=function(){var t=new At(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")};dt.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")};dt.prototype.checkPolygonal=function(){this._result instanceof st||this._result instanceof be||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")};dt.prototype.getErrorIndicator=function(){return this._errorIndicator};dt.prototype.getErrorLocation=function(){return this._errorLocation};dt.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};dt.prototype.report=function(t){if(!dt.VERBOSE)return null;ht.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};dt.prototype.getErrorMessage=function(){return this._errorMsg};dt.prototype.interfaces_=function(){return[]};dt.prototype.getClass=function(){return dt};dt.isValidMsg=function(t,e,r){var i=new dt(t,e,r);return i.isValid()?null:i.getErrorMessage()};dt.isValid=function(t,e,r){var i=new dt(t,e,r);return!!i.isValid()};pi.VERBOSE.get=function(){return!1};pi.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(dt,pi);var Le=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Le.prototype.getCoordinates=function(){return this._pts};Le.prototype.size=function(){return this._pts.length};Le.prototype.getCoordinate=function(t){return this._pts[t]};Le.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Le.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Or.octant(this.getCoordinate(t),this.getCoordinate(t+1))};Le.prototype.setData=function(t){this._data=t};Le.prototype.getData=function(){return this._data};Le.prototype.toString=function(){return ie.toLineString(new Q(this._pts))};Le.prototype.interfaces_=function(){return[Fe]};Le.prototype.getClass=function(){return Le};var ut=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new y,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};ut.prototype.getInteriorIntersection=function(){return this._interiorIntersection};ut.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};ut.prototype.getIntersectionSegments=function(){return this._intSegments};ut.prototype.count=function(){return this._intersectionCount};ut.prototype.getIntersections=function(){return this._intersections};ut.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};ut.prototype.setKeepIntersections=function(t){this._keepIntersections=t};ut.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};ut.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2};ut.prototype.hasIntersection=function(){return this._interiorIntersection!==null};ut.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};ut.prototype.interfaces_=function(){return[yr]};ut.prototype.getClass=function(){return ut};ut.createAllIntersectionsFinder=function(t){var e=new ut(t);return e.setFindAllIntersections(!0),e};ut.createAnyIntersectionFinder=function(t){return new ut(t)};ut.createIntersectionCounter=function(t){var e=new ut(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var ce=function(){this._li=new Sr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};ce.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};ce.prototype.getIntersections=function(){return this._segInt.getIntersections()};ce.prototype.isValid=function(){return this.execute(),this._isValid};ce.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};ce.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ut(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ui;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};ce.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Je(this.getErrorMessage(),this._segInt.getInteriorIntersection())};ce.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ie.toLineString(t[0],t[1])+" and "+ie.toLineString(t[2],t[3])};ce.prototype.interfaces_=function(){return[]};ce.prototype.getClass=function(){return ce};ce.computeIntersections=function(t){var e=new ce(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Cr=function n(){this._nv=null;var t=arguments[0];this._nv=new ce(n.toSegmentStrings(t))};Cr.prototype.checkValid=function(){this._nv.checkValid()};Cr.prototype.interfaces_=function(){return[]};Cr.prototype.getClass=function(){return Cr};Cr.toSegmentStrings=function(t){for(var e=new y,r=t.iterator();r.hasNext();){var i=r.next();e.add(new Le(i.getCoordinates(),i))}return e};Cr.checkValid=function(t){var e=new Cr(t);e.checkValid()};var Ar=function(t){this._mapOp=t};Ar.prototype.map=function(t){for(var e=this,r=new y,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||r.add(o)}return t.getFactory().createGeometryCollection(b.toGeometryArray(r))};Ar.prototype.interfaces_=function(){return[]};Ar.prototype.getClass=function(){return Ar};Ar.map=function(t,e){var r=new Ar(e);return r.map(t)};var Pe=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new y,this._resultLineList=new y;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};Pe.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}};Pe.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)};Pe.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList};Pe.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&O.isResultOfOp(i,e)&&!o.isCovered()&&(r.add(o),t.setVisitedEdge(!0))};Pe.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}};Pe.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}};Pe.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}};Pe.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;D.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),O.isResultOfOp(i,e)&&e===O.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))};Pe.prototype.interfaces_=function(){return[]};Pe.prototype.getClass=function(){return Pe};var Fr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new y;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Fr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}};Fr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===O.INTERSECTION)){var o=i.getLabel();O.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}};Fr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList};Fr.prototype.interfaces_=function(){return[]};Fr.prototype.getClass=function(){return Fr};var Mt=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Mt.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))};Mt.prototype.transformPolygon=function(t,e){var r=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Me)||o.isEmpty())&&(i=!1);for(var s=new y,a=0;a<t.getNumInteriorRing();a++){var u=r.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof Me||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new y;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)};Mt.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)};Mt.prototype.getInputGeometry=function(){return this._inputGeom};Mt.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new y,o=0;o<t.getNumGeometries();o++){var s=r.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)};Mt.prototype.transformCoordinates=function(t,e){return this.copy(t)};Mt.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))};Mt.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new y,o=0;o<t.getNumGeometries();o++){var s=r.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)};Mt.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new y,o=0;o<t.getNumGeometries();o++){var s=r.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)};Mt.prototype.copy=function(t){return t.copy()};Mt.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new y,o=0;o<t.getNumGeometries();o++){var s=r.transform(t.getGeometryN(o));s!==null&&(r._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(b.toGeometryArray(i)):this._factory.buildGeometry(i)};Mt.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Ft)return this.transformPoint(t,null);if(t instanceof Qr)return this.transformMultiPoint(t,null);if(t instanceof Me)return this.transformLinearRing(t,null);if(t instanceof K)return this.transformLineString(t,null);if(t instanceof mr)return this.transformMultiLineString(t,null);if(t instanceof st)return this.transformPolygon(t,null);if(t instanceof be)return this.transformMultiPolygon(t,null);if(t instanceof Lt)return this.transformGeometryCollection(t,null);throw new H("Unknown Geometry subtype: "+t.getClass().getName())};Mt.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)};Mt.prototype.interfaces_=function(){return[]};Mt.prototype.getClass=function(){return Mt};var Ve=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new x,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof K&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];n.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};Ve.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=r.findSnapForVertex(s,e);a!==null&&(t.set(o,new p(a)),o===0&&r._isClosed&&t.set(t.size()-1,new p(a)))}};Ve.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null};Ve.prototype.snapTo=function(t){var e=new Dn(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r};Ve.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=r.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new p(s),!1)}};Ve.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=w.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(r._seg.p0=e.get(s),r._seg.p1=e.get(s+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(t);a<r._snapTolerance&&a<i&&(i=a,o=s)}return o};Ve.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t};Ve.prototype.interfaces_=function(){return[]};Ve.prototype.getClass=function(){return Ve};Ve.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Z=function(t){this._srcGeom=t||null},Yi={SNAP_PRECISION_FACTOR:{configurable:!0}};Z.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Hi(e,r);return i.transform(this._srcGeom)};Z.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Hi(t,r,!0),o=i.transform(this._srcGeom),s=o;return e&&P(s,ir)&&(s=o.buffer(0)),s};Z.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r};Z.prototype.extractTargetCoordinates=function(t){for(var e=new ye,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))};Z.prototype.computeMinimumSegmentLength=function(t){for(var e=w.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e};Z.prototype.interfaces_=function(){return[]};Z.prototype.getClass=function(){return Z};Z.snap=function(t,e,r){var i=new Array(2).fill(null),o=new Z(t);i[0]=o.snapTo(e,r);var s=new Z(e);return i[1]=s.snapTo(i[0],r),i};Z.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Z.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===V.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(Z.computeOverlaySnapTolerance(o),Z.computeOverlaySnapTolerance(s))}};Z.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*Z.SNAP_PRECISION_FACTOR;return i};Z.snapToSelf=function(t,e,r){var i=new Z(t);return i.snapToSelf(e,r)};Yi.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(Z,Yi);var Hi=function(n){function t(e,r,i){n.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var o=new Ve(r,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var o=r.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mt),Ct=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Ct.prototype.getCommon=function(){return w.longBitsToDouble(this._commonBits)};Ct.prototype.add=function(t){var e=w.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Ct.signExpBits(this._commonBits),this._isFirst=!1,null;var r=Ct.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Ct.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Ct.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};Ct.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=w.longBitsToDouble(t),r=w.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}};Ct.prototype.interfaces_=function(){return[]};Ct.prototype.getClass=function(){return Ct};Ct.getBit=function(t,e){var r=1<<e;return t&r?1:0};Ct.signExpBits=function(t){return t>>52};Ct.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,o=t&i;return o};Ct.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(Ct.getBit(t,i)!==Ct.getBit(e,i))return r;r++}return 52};var fr=function(){this._commonCoord=null,this._ccFilter=new Br},hi={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};fr.prototype.addCommonBits=function(t){var e=new pr(this._commonCoord);t.apply(e),t.geometryChanged()};fr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new p(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new pr(e);return t.apply(r),t.geometryChanged(),t};fr.prototype.getCommonCoordinate=function(){return this._commonCoord};fr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};fr.prototype.interfaces_=function(){return[]};fr.prototype.getClass=function(){return fr};hi.CommonCoordinateFilter.get=function(){return Br};hi.Translater.get=function(){return pr};Object.defineProperties(fr,hi);var Br=function(){this._commonBitsX=new Ct,this._commonBitsY=new Ct};Br.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};Br.prototype.getCommonCoordinate=function(){return new p(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};Br.prototype.interfaces_=function(){return[Te]};Br.prototype.getClass=function(){return Br};var pr=function(){this.trans=null;var t=arguments[0];this.trans=t};pr.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)};pr.prototype.isDone=function(){return!1};pr.prototype.isGeometryChanged=function(){return!0};pr.prototype.interfaces_=function(){return[oe]};pr.prototype.getClass=function(){return pr};var lt=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()};lt.prototype.selfSnap=function(t){var e=new Z(t),r=e.snapTo(t,this._snapTolerance);return r};lt.prototype.removeCommonBits=function(t){this._cbr=new fr,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};lt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};lt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=O.overlayOp(e[0],e[1],t);return this.prepareResult(r)};lt.prototype.checkValid=function(t){t.isValid()||ht.out.println("Snapped geometry is invalid")};lt.prototype.computeSnapTolerance=function(){this._snapTolerance=Z.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};lt.prototype.snap=function(t){var e=this.removeCommonBits(t),r=Z.snap(e[0],e[1],this._snapTolerance);return r};lt.prototype.interfaces_=function(){return[]};lt.prototype.getClass=function(){return lt};lt.overlayOp=function(t,e,r){var i=new lt(t,e);return i.getResultGeometry(r)};lt.union=function(t,e){return lt.overlayOp(t,e,O.UNION)};lt.intersection=function(t,e){return lt.overlayOp(t,e,O.INTERSECTION)};lt.symDifference=function(t,e){return lt.overlayOp(t,e,O.SYMDIFFERENCE)};lt.difference=function(t,e){return lt.overlayOp(t,e,O.DIFFERENCE)};var Ot=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Ot.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=O.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(r=!0)}catch(s){if(s instanceof je)i=s;else throw s}finally{}if(!r)try{e=lt.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof je?i:s}finally{}return e};Ot.prototype.interfaces_=function(){return[]};Ot.prototype.getClass=function(){return Ot};Ot.overlayOp=function(t,e,r){var i=new Ot(t,e);return i.getResultGeometry(r)};Ot.union=function(t,e){return Ot.overlayOp(t,e,O.UNION)};Ot.intersection=function(t,e){return Ot.overlayOp(t,e,O.INTERSECTION)};Ot.symDifference=function(t,e){return Ot.overlayOp(t,e,O.SYMDIFFERENCE)};Ot.difference=function(t,e){return Ot.overlayOp(t,e,O.DIFFERENCE)};var Sn=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Sn.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)};Sn.prototype.interfaces_=function(){return[]};Sn.prototype.getClass=function(){return Sn};var Vt=function n(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=n.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=o}},gi={INSERT:{configurable:!0},DELETE:{configurable:!0}};Vt.prototype.isDelete=function(){return this._eventType===Vt.DELETE};Vt.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};Vt.prototype.getObject=function(){return this._obj};Vt.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};Vt.prototype.getInsertEvent=function(){return this._insertEvent};Vt.prototype.isInsert=function(){return this._eventType===Vt.INSERT};Vt.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};Vt.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};Vt.prototype.interfaces_=function(){return[$t]};Vt.prototype.getClass=function(){return Vt};gi.INSERT.get=function(){return 1};gi.DELETE.get=function(){return 2};Object.defineProperties(Vt,gi);var Gn=function(){};Gn.prototype.interfaces_=function(){return[]};Gn.prototype.getClass=function(){return Gn};var mt=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],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};mt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(mt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1};mt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};mt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};mt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};mt.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1};mt.prototype.hasProperIntersection=function(){return this._hasProper};mt.prototype.hasIntersection=function(){return this._hasIntersection};mt.prototype.isDone=function(){return this._isDone};mt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))};mt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e};mt.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,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))))};mt.prototype.interfaces_=function(){return[]};mt.prototype.getClass=function(){return mt};mt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var go=function(n){function t(){n.call(this),this.events=new y,this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;ae.sort(this.events);for(var i=0;i<this.events.size();i++){var o=r.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=r.events.get(o);if(s.isInsert()&&r.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof mt&&P(arguments[0],ne)&&P(arguments[1],ne)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&P(arguments[0],ne)&&arguments[1]instanceof mt){var c=arguments[0],f=arguments[1],g=arguments[2];g?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(r,i){for(var o=this,s=r.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Sn(s,u),c=new Vt(i,s.getMinX(u),l);o.events.add(c),o.events.add(new Vt(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(r,i,o,s){for(var a=this,u=o.getObject(),l=r;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();r.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();r.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Gn),ze=function(){this._min=w.POSITIVE_INFINITY,this._max=w.NEGATIVE_INFINITY},Wi={NodeComparator:{configurable:!0}};ze.prototype.getMin=function(){return this._min};ze.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)};ze.prototype.getMax=function(){return this._max};ze.prototype.toString=function(){return ie.toLineString(new p(this._min,0),new p(this._max,0))};ze.prototype.interfaces_=function(){return[]};ze.prototype.getClass=function(){return ze};Wi.NodeComparator.get=function(){return Ln};Object.defineProperties(ze,Wi);var Ln=function(){};Ln.prototype.compare=function(t,e){var r=t,i=e,o=(r._min+r._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0};Ln.prototype.interfaces_=function(){return[Xr]};Ln.prototype.getClass=function(){return Ln};var mo=function(n){function t(){n.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,o){if(!this.intersects(r,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ze),vo=function(n){function t(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,o){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,o),this._node2!==null&&this._node2.query(r,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ze),Ue=function(){this._leaves=new y,this._root=null,this._level=0};Ue.prototype.buildTree=function(){var t=this;ae.sort(this._leaves,new ze.NodeComparator);for(var e=this._leaves,r=null,i=new y;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}};Ue.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new mo(t,e,r))};Ue.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)};Ue.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};Ue.prototype.printNode=function(t){ht.out.println(ie.toLineString(new p(t._min,this._level),new p(t._max,this._level)))};Ue.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};Ue.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),o=r+1<t.size()?t.get(r):null;if(o===null)e.add(i);else{var s=new vo(t.get(r),t.get(r+1));e.add(s)}}};Ue.prototype.interfaces_=function(){return[]};Ue.prototype.getClass=function(){return Ue};var nn=function(){this._items=new y};nn.prototype.visitItem=function(t){this._items.add(t)};nn.prototype.getItems=function(){return this._items};nn.prototype.interfaces_=function(){return[or]};nn.prototype.getClass=function(){return nn};var on=function(){this._index=null;var t=arguments[0];if(!P(t,ir))throw new H("Argument must be Polygonal");this._index=new Nr(t)},di={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};on.prototype.locate=function(t){var e=new me(t),r=new sn(e);return this._index.query(t.y,t.y,r),e.getLocation()};on.prototype.interfaces_=function(){return[en]};on.prototype.getClass=function(){return on};di.SegmentVisitor.get=function(){return sn};di.IntervalIndexedGeometry.get=function(){return Nr};Object.defineProperties(on,di);var sn=function(){this._counter=null;var t=arguments[0];this._counter=t};sn.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))};sn.prototype.interfaces_=function(){return[or]};sn.prototype.getClass=function(){return sn};var Nr=function(){this._index=new Ue;var t=arguments[0];this.init(t)};Nr.prototype.init=function(t){for(var e=this,r=ct.getLines(t),i=r.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}};Nr.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new x(t[r-1],t[r]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}};Nr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new nn;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}};Nr.prototype.interfaces_=function(){return[]};Nr.prototype.getClass=function(){return Nr};var hn=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new Di,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new le,arguments.length===2){var e=arguments[0],r=arguments[1],i=Jt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=h.NONE;u=s.getLocation(r,v.ON),u===h.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new mt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Me||this._parentGeom instanceof st||this._parentGeom instanceof be,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,o){var s=new mt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof Ft){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,h.INTERIOR)}else if(arguments[0]instanceof p){var o=arguments[0];this.insertPoint(this._argIndex,o,h.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),h.EXTERIOR,h.INTERIOR);for(var o=0;o<r.getNumInteriorRing();o++){var s=r.getInteriorRingN(o);i.addPolygonRing(s,h.INTERIOR,h.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],h.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],h.BOUNDARY)},t.prototype.addLineString=function(r){var i=R.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Bn(i,new U(this._argIndex,h.INTERIOR));this._lineEdgeMap.put(r,o),this.insertEdge(o),D.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),o=0,s=r.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(r,i,o){if(this.isBoundaryNode(r,i))return null;o===h.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,o)},t.prototype.addPolygonRing=function(r,i,o){if(r.isEmpty())return null;var s=R.removeRepeatedPoints(r.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;I.isCCW(s)&&(a=o,u=i);var l=new Bn(s,new U(this._argIndex,h.BOUNDARY,a,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],h.BOUNDARY)},t.prototype.insertPoint=function(r,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new U(r,o):a.setLocation(r,o)},t.prototype.createEdgeSetIntersector=function(){return new go},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(r),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof be&&(this._useBoundaryDeterminationRule=!1),r instanceof st)this.addPolygon(r);else if(r instanceof K)this.addLineString(r);else if(r instanceof Ft)this.addPoint(r);else if(r instanceof Qr)this.addCollection(r);else if(r instanceof mr)this.addCollection(r);else if(r instanceof be)this.addCollection(r);else if(r instanceof Lt)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,o=0;o<r.getNumGeometries();o++){var s=r.getGeometryN(o);i.add(s)}},t.prototype.locate=function(r){return P(this._parentGeom,ir)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new on(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?h.BOUNDARY:h.INTERIOR},t}(j),an=function(){if(this._li=new Sr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new hn(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Jt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new hn(0,e,i),this._arg[1]=new hn(1,r,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new hn(0,o,a),this._arg[1]=new hn(1,s,a)}};an.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};an.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};an.prototype.interfaces_=function(){return[]};an.prototype.getClass=function(){return an};var dr=function(){};dr.prototype.interfaces_=function(){return[]};dr.prototype.getClass=function(){return dr};dr.map=function(){if(arguments[0]instanceof L&&P(arguments[1],dr.MapOp)){for(var t=arguments[0],e=arguments[1],r=new y,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&r.add(o)}return t.getFactory().buildGeometry(r)}else if(P(arguments[0],it)&&P(arguments[1],dr.MapOp)){for(var s=arguments[0],a=arguments[1],u=new y,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}};dr.MapOp=function(){};var O=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r),this._ptLocator=new le,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new ue,this._resultPolyList=new y,this._resultLineList=new y,this._resultPointList=new y,this._graph=new j(new Gi),this._geomFact=e.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var o=i.getLabel(),s=r.getLabel();i.isPointwiseEqual(r)||(s=new U(r.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,o,s){var a=new y;return a.addAll(r),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(r,a);if(u!==h.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new y,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),r.add(o.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,o=r.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(r){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 i=new y;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Cr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var o=new Bt(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new Pe(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(r);var a=new Fr(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var o=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(r){for(var i=this,o=this._arg[r].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(r,s.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,v.RIGHT),s.getLocation(1,v.RIGHT),r)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(D.isTrue(!s.isNull(a,v.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,v.LEFT,s.getLocation(a,v.LEFT)),D.isTrue(!s.isNull(a,v.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,v.RIGHT,s.getLocation(a,v.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?r.labelIncompleteNode(o,0):r.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(an);O.overlayOp=function(n,t,e){var r=new O(n,t),i=r.getResultGeometry(e);return i};O.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return O.createEmptyResult(O.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var e=t;return Ar.map(n,{interfaces_:function(){return[dr.MapOp]},map:function(r){return r.intersection(e)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),Ot.overlayOp(n,t,O.INTERSECTION)};O.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return O.createEmptyResult(O.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),Ot.overlayOp(n,t,O.SYMDIFFERENCE)};O.resultDimension=function(n,t,e){var r=t.getDimension(),i=e.getDimension(),o=-1;switch(n){case O.INTERSECTION:o=Math.min(r,i);break;case O.UNION:o=Math.max(r,i);break;case O.DIFFERENCE:o=r;break;case O.SYMDIFFERENCE:o=Math.max(r,i);break}return o};O.createEmptyResult=function(n,t,e,r){var i=null;switch(O.resultDimension(n,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i};O.difference=function(n,t){return n.isEmpty()?O.createEmptyResult(O.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),Ot.overlayOp(n,t,O.DIFFERENCE))};O.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],t=arguments[1],e=n.getLocation(0),r=n.getLocation(1);return O.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===h.BOUNDARY&&(i=h.INTERIOR),o===h.BOUNDARY&&(o=h.INTERIOR),s){case O.INTERSECTION:return i===h.INTERIOR&&o===h.INTERIOR;case O.UNION:return i===h.INTERIOR||o===h.INTERIOR;case O.DIFFERENCE:return i===h.INTERIOR&&o!==h.INTERIOR;case O.SYMDIFFERENCE:return i===h.INTERIOR&&o!==h.INTERIOR||i!==h.INTERIOR&&o===h.INTERIOR}return!1}};O.INTERSECTION=1;O.UNION=2;O.DIFFERENCE=3;O.SYMDIFFERENCE=4;var nr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new le,this._seg=new x;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};nr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1};nr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?h.BOUNDARY:this._ptLocator.locate(t,this._g)};nr.prototype.extractLinework=function(t){var e=new un;t.apply(e);var r=e.getLinework(),i=b.toLineStringArray(r);return t.getFactory().createMultiLineString(i)};nr.prototype.interfaces_=function(){return[]};nr.prototype.getClass=function(){return nr};var un=function(){this._linework=null,this._linework=new y};un.prototype.getLinework=function(){return this._linework};un.prototype.filter=function(t){var e=this;if(t instanceof st){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}};un.prototype.interfaces_=function(){return[Ie]};un.prototype.getClass=function(){return un};var xr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};xr.prototype.extractPoints=function(t,e,r){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,r)};xr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e};xr.prototype.getPoints=function(t){for(var e=this,r=new y,i=ct.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,r)}return r};xr.prototype.computeOffsetPoints=function(t,e,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=r*o/a,l=r*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var g=new p(c-l,f+u);i.add(g)}if(this._doRight){var m=new p(c+l,f-u);i.add(m)}};xr.prototype.interfaces_=function(){return[]};xr.prototype.getClass=function(){return xr};var Ht=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new y;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new nr(this._geom[0],this._boundaryDistanceTolerance),new nr(this._geom[1],this._boundaryDistanceTolerance),new nr(this._geom[2],this._boundaryDistanceTolerance)]},ji={TOLERANCE:{configurable:!0}};Ht.prototype.reportResult=function(t,e,r){ht.out.println("Overlay result invalid - A:"+h.toLocationSymbol(e[0])+" B:"+h.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+h.toLocationSymbol(e[2]))};Ht.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e};Ht.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),Ht.hasLocation(this._location,h.BOUNDARY)?!0:this.isValidResult(o,this._location)}};Ht.prototype.addTestPts=function(t){var e=new xr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))};Ht.prototype.isValidResult=function(t,e){var r=O.isResultOfOp(e[0],e[1],t),i=e[2]===h.INTERIOR,o=!(r^i);return o||this.reportResult(t,e,r),o};Ht.prototype.getInvalidLocation=function(){return this._invalidLocation};Ht.prototype.interfaces_=function(){return[]};Ht.prototype.getClass=function(){return Ht};Ht.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1};Ht.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Z.computeSizeBasedSnapTolerance(t),Z.computeSizeBasedSnapTolerance(e))};Ht.isValid=function(t,e,r,i){var o=new Ht(t,e,i);return o.isValid(r)};ji.TOLERANCE.get=function(){return 1e-6};Object.defineProperties(Ht,ji);var zt=function n(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(t),this._inputGeoms=t};zt.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);r._skipEmpty&&o.isEmpty()||e.add(o)}};zt.prototype.combine=function(){for(var t=this,e=new y,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)};zt.prototype.interfaces_=function(){return[]};zt.prototype.getClass=function(){return zt};zt.combine=function(){if(arguments.length===1){var t=arguments[0],e=new zt(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o=new zt(zt.createList(r,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new zt(zt.createList(s,a,u));return l.combine()}};zt.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()};zt.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new y;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new y;return a.add(i),a.add(o),a.add(s),a}};var rt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new y)},Ki={STRTREE_NODE_CAPACITY:{configurable:!0}};rt.prototype.reduceToGeometries=function(t){for(var e=this,r=new y,i=t.iterator();i.hasNext();){var o=i.next(),s=null;P(o,ne)?s=e.unionTree(o):o instanceof L&&(s=o),r.add(s)}return r};rt.prototype.extractByEnvelope=function(t,e,r){for(var i=new y,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):r.add(s)}return this._geomFactory.buildGeometry(i)};rt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var o=zt.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)};rt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Mi(rt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o};rt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var o=rt.getGeometry(e,r);return this.unionSafe(o,null)}else{if(i-r===2)return this.unionSafe(rt.getGeometry(e,r),rt.getGeometry(e,r+1));var s=Math.trunc((i+r)/2),a=this.binaryUnion(e,r,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}};rt.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e};rt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)};rt.prototype.unionActual=function(t,e){return rt.restrictToPolygons(t.union(e))};rt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r};rt.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new y,o=this.extractByEnvelope(r,t,i),s=this.extractByEnvelope(r,e,i),a=this.unionActual(o,s);i.add(a);var u=zt.combine(i);return u};rt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}};rt.prototype.interfaces_=function(){return[]};rt.prototype.getClass=function(){return rt};rt.restrictToPolygons=function(t){if(P(t,ir))return t;var e=We.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(b.toPolygonArray(e))};rt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)};rt.union=function(t){var e=new rt(t);return e.union()};Ki.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(rt,Ki);var Pn=function(){};Pn.prototype.interfaces_=function(){return[]};Pn.prototype.getClass=function(){return Pn};Pn.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return O.createEmptyResult(O.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ot.overlayOp(t,e,O.UNION)};exports.BufferOp=ft;exports.GeoJSONReader=ai;exports.GeoJSONWriter=Ri;exports.OverlayOp=O;exports.UnionOp=Pn;
1
+ "use strict";function u(e,t){for(var n=t.length,r=0;r<n;r++){if(e==null)return;e=e[t[r]]}return n?e:void 0}module.exports=u;
5
2
  //# sourceMappingURL=index.cjs220.js.map